mirror of
https://github.com/caoer/CodableFirebase.git
synced 2026-06-15 01:18:59 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1384814716 | ||
|
|
b0e86866a0 | ||
|
|
0c60f70d91 | ||
|
|
df9dfe1dda |
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "CodableFirebase"
|
||||
s.version = "0.0.5"
|
||||
s.version = "0.0.6"
|
||||
s.summary = "Use Codable with Firebase"
|
||||
s.description = "This library helps you use your custom models that conform to Codable protocol with Firebase Realtime Database and Firestore"
|
||||
s.homepage = "https://github.com/alickbass/CodableFirebase"
|
||||
|
||||
@@ -383,6 +383,8 @@ extension _FirebaseEncoder {
|
||||
return try self.box((value as! Data))
|
||||
} else if T.self == URL.self || T.self == NSURL.self {
|
||||
return self.box((value as! URL).absoluteString)
|
||||
} else if T.self == Decimal.self || T.self == NSDecimalNumber.self {
|
||||
return (value as! NSDecimalNumber)
|
||||
} else if options.skipFirestoreTypes && (value is FirestoreEncodable) {
|
||||
guard let value = value as? NSObject else {
|
||||
throw DocumentReferenceError.typeIsNotNSObject
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.0.5</string>
|
||||
<string>0.0.6</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
||||
@@ -109,6 +109,11 @@ class TestCodableFirestore: XCTestCase {
|
||||
_testRoundTrip(of: TopLevelWrapper(date), expected: ["value": date])
|
||||
}
|
||||
|
||||
func testDecimalValue() {
|
||||
let value = Decimal(2)
|
||||
_testRoundTrip(of: TopLevelWrapper(value), expected: ["value": value])
|
||||
}
|
||||
|
||||
// MARK: - GeoPoint & Document Reference
|
||||
func testEncodingGeoPoint() {
|
||||
let point = GeoPoint(latitude: 2, longitude: 2)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# CodableFirebase
|
||||
Use [Codable](https://developer.apple.com/documentation/swift/codable) with [Firebase](https://firebase.google.com)
|
||||
|
||||
[]()
|
||||
[](https://github.com/alickbass/CodableFirebase)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](https://travis-ci.org/alickbass/CodableFirebase)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user