ardm 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ardm/active_record/associations.rb +8 -1
- data/lib/ardm/version.rb +1 -1
- metadata +2 -2
@@ -39,8 +39,15 @@ module Ardm
|
|
39
39
|
end
|
40
40
|
[ar]
|
41
41
|
else
|
42
|
-
|
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
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.
|
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-
|
13
|
+
date: 2014-10-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|