referrable_joins 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,23 @@
1
1
  module ActiveRecord
2
-
2
+
3
+ module FinderMethods
4
+ def find_with_associations
5
+ including = (@eager_load_values + @includes_values).uniq
6
+ join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, including, nil, nil)
7
+ rows = construct_relation_for_association_find(join_dependency).to_a
8
+ join_dependency.instantiate(rows)
9
+ rescue ThrowResult
10
+ []
11
+ end
12
+
13
+ def construct_relation_for_association_calculations
14
+ including = (@eager_load_values + @includes_values).uniq
15
+ join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, including, nil, arel.joins(arel))
16
+ relation = except(:includes, :eager_load, :preload)
17
+ apply_join_dependency(relation, join_dependency)
18
+ end
19
+ end
20
+
3
21
  module SpawnMethods
4
22
  def merge(r)
5
23
  merged_relation = clone
@@ -1,3 +1,3 @@
1
1
  module ReferrableJoins
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: referrable_joins
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
5
+ version: 0.2.3
11
6
  platform: ruby
12
7
  authors:
13
8
  - Burke Libbey
@@ -15,8 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-04-04 00:00:00 -05:00
19
- default_executable:
13
+ date: 2011-06-20 00:00:00 Z
20
14
  dependencies: []
21
15
 
22
16
  description: Adds the ability to refer to columns in a specific auto-generated join using the Arel::Table class
@@ -37,7 +31,6 @@ files:
37
31
  - lib/referrable_joins/active_record_hacks.rb
38
32
  - lib/referrable_joins/version.rb
39
33
  - referrable_joins.gemspec
40
- has_rdoc: true
41
34
  homepage: ""
42
35
  licenses: []
43
36
 
@@ -51,23 +44,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
44
  requirements:
52
45
  - - ">="
53
46
  - !ruby/object:Gem::Version
54
- hash: 3
55
- segments:
56
- - 0
57
47
  version: "0"
58
48
  required_rubygems_version: !ruby/object:Gem::Requirement
59
49
  none: false
60
50
  requirements:
61
51
  - - ">="
62
52
  - !ruby/object:Gem::Version
63
- hash: 3
64
- segments:
65
- - 0
66
53
  version: "0"
67
54
  requirements: []
68
55
 
69
56
  rubyforge_project:
70
- rubygems_version: 1.6.0
57
+ rubygems_version: 1.7.2
71
58
  signing_key:
72
59
  specification_version: 3
73
60
  summary: Adds the ability to refer to columns in a specific auto-generated join using the Arel::Table class