ardm 0.2.0 → 0.2.1

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.
@@ -39,8 +39,15 @@ module Ardm
39
39
  end
40
40
  [ar]
41
41
  else
42
- block = if (conditions = ar.slice!(*keep)).any?
42
+ order = ar.delete(:order)
43
+ conditions = ar.slice!(*keep)
44
+ # sigh
45
+ block = if conditions.any? && order
46
+ lambda { where(conditions).order(order) }
47
+ elsif conditions.any?
43
48
  lambda { where(conditions) }
49
+ elsif order
50
+ lambda { order(order) }
44
51
  end
45
52
  [block, ar].compact
46
53
  end
data/lib/ardm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ardm
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ardm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-09-11 00:00:00.000000000 Z
13
+ date: 2014-10-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport