memorydb 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/memorydb/db.rb +3 -3
  2. metadata +1 -1
@@ -177,9 +177,9 @@ module MemoryDb
177
177
 
178
178
  def compare_model(model1, model2, sort)
179
179
  field1, field2 = model1[sort.field], model2[sort.field]
180
- field1 == field2 ? nil :
181
- (field1.nil? ? true : (field1 < field2)) && sort.order == :asc ? -1 :
182
- (field1.nil? ? false : (field1 > field2)) && sort.order == :desc ? -1 : 1
180
+ field1 == field2 ? nil :
181
+ (field1.nil? ? true : (field2.nil? ? false : (field1 < field2))) && sort.order == :asc ? -1 :
182
+ (field1.nil? ? false : (field2.nil? ? true : (field1 > field2))) && sort.order == :desc ? -1 : 1
183
183
  end
184
184
 
185
185
  def limit_models(models, limit)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memorydb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: