activerecord-collections 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d6b4baa140c325ec88e2c55175e2bae0d55566c
4
- data.tar.gz: 3a463c83e5790a296d570eabedaa1d30bde7085e
3
+ metadata.gz: 2abef191dff39cbfc9eea961ada24c900a468283
4
+ data.tar.gz: 6a5e84efad9a8ca109250a6b300dba9ef6dcc25d
5
5
  SHA512:
6
- metadata.gz: 7ce87631a746258bb7ae4fbeead8deec3c55c547b04fcc1c668314fbf1db11e9cfd81432b4a2ae09932269351ae4ce76c6374ac531b13c300a7a906006dad098
7
- data.tar.gz: 285370a57bbff5c61496987e14417c835b748c8c535ee8f26bfe644c06f092f6525d04cb98821168ead1ff8f19cef607049109c0a03efbdba39c81dab280bb76
6
+ metadata.gz: 52972f40deada1316b689444eaa8fa2814184f0731ab64ff2b13605b8ae0a8fd685d53e0dbffa58401c209635c2289995d9cb0ed0230e5311af33be5a6a97102
7
+ data.tar.gz: fcc224924a45de375be95d92485bcfd5583a1f9fb838dc61670109a944a306cfd5d69c6a198c9e1e6aed83fbbeaf13455fefc15447f07c9f5bb893ff05b536c4
@@ -82,7 +82,7 @@ module ActiveRecord
82
82
  end
83
83
 
84
84
  def call_on_relation(meth, *args)
85
- reset!
85
+ reset!(false, false)
86
86
  returned = relation.send(meth, *args)
87
87
  if returned.is_a?(ActiveRecord::Relation)
88
88
  @relation = returned
@@ -128,6 +128,20 @@ module ActiveRecord
128
128
  self
129
129
  end
130
130
 
131
+ # TODO make this not dependent on kaminari
132
+ def page!(*args)
133
+ @relation = relation.page(*args)
134
+ self
135
+ end
136
+ alias_method :page, :page!
137
+
138
+ def per!(*args)
139
+ @relation = relation.page((relation.offset_value / relation.limit_value) + 1).per(*args)
140
+ self
141
+ end
142
+ alias_method :per, :per!
143
+ # END kaminari
144
+
131
145
  def joins(*args)
132
146
  dup.joins!(*args)
133
147
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Collections
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-collections
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec