Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arturdev committed Apr 14, 2020
1 parent 650e760 commit b567aa2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Unrealm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|
s.name = 'Unrealm'
s.swift_version = '5.1'
s.version = '1.2.1'
s.version = '1.2.2'
s.summary = 'Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm.'
s.description = <<-DESC
Unrealm enables you to easily store Swift native Classes, Structs and Enums into Realm.
Expand Down
2 changes: 1 addition & 1 deletion Unrealm/Classes/Swift/Unrealm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public extension Object {

func toRealmable() -> RealmableBase? {
let objTypeString = self.typeString() ?? ""
if let type = objectsAndRealmables.first(where: {objTypeString.contains($0.key)})?.value {
if let type = objectsAndRealmables.filter({objTypeString.contains($0.key)}).map{($0, $1)}.sorted(by: {$0.0 > $1.0}).first?.1 {
let convertedObj = self.toRealmable(of: type)
return convertedObj as? RealmableBase
}
Expand Down

0 comments on commit b567aa2

Please sign in to comment.