in_place_relation 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module InPlaceRelation
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -7,10 +7,14 @@ module InPlaceRelation
7
7
  module Methods
8
8
 
9
9
  def in_place
10
- # To keep things unified we always want a Relation here even if initial
11
- # object was a model class or an association
12
- rel = self.is_a?( ActiveRecord::Relation ) ? self : self.scoped
13
- return Wrapper.new( rel )
10
+ # Previously, to keep things unified we always want a Relation here even
11
+ # if initial object was a model class or an association.
12
+ # But the problem is that now rel.is_a? triggers fetch on an association
13
+ # (really, how stupid you have to be to create a monster like
14
+ # ActiveRecord::Associations::CollectionAssociation that even returns
15
+ # Array as it's class?
16
+ #rel = self.is_a?( ActiveRecord::Relation ) ? self : self.scoped
17
+ return Wrapper.new( rel.scoped )
14
18
  end
15
19
  end
16
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: in_place_relation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-30 00:00:00.000000000 Z
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord-nulldb-adapter
16
- requirement: &20547880 !ruby/object:Gem::Requirement
16
+ requirement: &3265540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *20547880
24
+ version_requirements: *3265540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activerecord
27
- requirement: &20547380 !ruby/object:Gem::Requirement
27
+ requirement: &3264840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *20547380
35
+ version_requirements: *3264840
36
36
  description: ActiveRecord::Relation wrapper that can be modified/combined in place
37
37
  email:
38
38
  - marek@janukowicz.net
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  requirements: []
70
70
  rubyforge_project:
71
- rubygems_version: 1.8.10
71
+ rubygems_version: 1.8.17
72
72
  signing_key:
73
73
  specification_version: 3
74
74
  summary: A relation that can be changed in place