grouped_scope 3.1.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -3
- data/CHANGELOG +5 -0
- data/Gemfile +2 -1
- data/README.md +2 -2
- data/lib/grouped_scope.rb +1 -0
- data/lib/grouped_scope/arish/relation/predicate_builer.rb +2 -3
- data/lib/grouped_scope/version.rb +1 -1
- data/test/helper.rb +2 -3
- metadata +60 -107
- data/Gemfile.rails-3.1 +0 -9
- data/Gemfile.rails-3.2 +0 -9
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
source :rubygems
|
2
|
+
gemspec
|
data/README.md
CHANGED
@@ -8,10 +8,10 @@ GroupedScope provides an easy way to group objects and to allow those groups to
|
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
|
-
Install the gem with bundler. We follow a semantic versioning format that tracks ActiveRecord's minor version. So this means to use the latest 3.
|
11
|
+
Install the gem with bundler. We follow a semantic versioning format that tracks ActiveRecord's minor version. So this means to use the latest 3.2.x version of GroupedScope with any ActiveRecord 3.2 version.
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem 'grouped_scope', '~> 3.
|
14
|
+
gem 'grouped_scope', '~> 3.2.0'
|
15
15
|
```
|
16
16
|
|
17
17
|
|
data/lib/grouped_scope.rb
CHANGED
@@ -9,13 +9,12 @@ module GroupedScope
|
|
9
9
|
end
|
10
10
|
|
11
11
|
module ClassMethods
|
12
|
-
|
13
|
-
def build_from_hash_with_grouped_scope(engine, attributes, default_table)
|
12
|
+
def build_from_hash_with_grouped_scope(engine, attributes, default_table, check_column = true)
|
14
13
|
attributes.select{ |column, value| GroupedScope::SelfGroupping === value }.each do |column_value|
|
15
14
|
column, value = column_value
|
16
15
|
attributes[column] = value.arel_table[column.to_s].in(value.ids_sql)
|
17
16
|
end
|
18
|
-
build_from_hash_without_grouped_scope(engine, attributes, default_table)
|
17
|
+
build_from_hash_without_grouped_scope(engine, attributes, default_table, check_column)
|
19
18
|
end
|
20
19
|
|
21
20
|
end
|
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,132 +1,93 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: grouped_scope
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.2.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 1
|
9
|
-
- 2
|
10
|
-
version: 3.1.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Ken Collins
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-06-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: activerecord
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70169324150120 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 3
|
31
|
-
- 1
|
32
|
-
version: "3.1"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.0
|
33
22
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: sqlite3
|
37
23
|
prerelease: false
|
38
|
-
|
24
|
+
version_requirements: *70169324150120
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: sqlite3
|
27
|
+
requirement: &70169324148520 !ruby/object:Gem::Requirement
|
39
28
|
none: false
|
40
|
-
requirements:
|
29
|
+
requirements:
|
41
30
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
segments:
|
45
|
-
- 1
|
46
|
-
- 3
|
47
|
-
version: "1.3"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.3'
|
48
33
|
type: :development
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: rake
|
52
34
|
prerelease: false
|
53
|
-
|
35
|
+
version_requirements: *70169324148520
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake
|
38
|
+
requirement: &70169324147520 !ruby/object:Gem::Requirement
|
54
39
|
none: false
|
55
|
-
requirements:
|
40
|
+
requirements:
|
56
41
|
- - ~>
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
hash: 63
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
- 9
|
62
|
-
- 2
|
42
|
+
- !ruby/object:Gem::Version
|
63
43
|
version: 0.9.2
|
64
44
|
type: :development
|
65
|
-
version_requirements: *id003
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
|
-
name: minitest
|
68
45
|
prerelease: false
|
69
|
-
|
46
|
+
version_requirements: *70169324147520
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: minitest
|
49
|
+
requirement: &70169324146780 !ruby/object:Gem::Requirement
|
70
50
|
none: false
|
71
|
-
requirements:
|
51
|
+
requirements:
|
72
52
|
- - ~>
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
hash: 45
|
75
|
-
segments:
|
76
|
-
- 2
|
77
|
-
- 8
|
78
|
-
- 1
|
53
|
+
- !ruby/object:Gem::Version
|
79
54
|
version: 2.8.1
|
80
55
|
type: :development
|
81
|
-
version_requirements: *id004
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: factory_girl
|
84
56
|
prerelease: false
|
85
|
-
|
57
|
+
version_requirements: *70169324146780
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: factory_girl
|
60
|
+
requirement: &70169324146060 !ruby/object:Gem::Requirement
|
86
61
|
none: false
|
87
|
-
requirements:
|
62
|
+
requirements:
|
88
63
|
- - ~>
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
hash: 7
|
91
|
-
segments:
|
92
|
-
- 2
|
93
|
-
- 3
|
94
|
-
- 2
|
64
|
+
- !ruby/object:Gem::Version
|
95
65
|
version: 2.3.2
|
96
66
|
type: :development
|
97
|
-
version_requirements: *id005
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: mocha
|
100
67
|
prerelease: false
|
101
|
-
|
68
|
+
version_requirements: *70169324146060
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: mocha
|
71
|
+
requirement: &70169324145600 !ruby/object:Gem::Requirement
|
102
72
|
none: false
|
103
|
-
requirements:
|
73
|
+
requirements:
|
104
74
|
- - ~>
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
hash: 55
|
107
|
-
segments:
|
108
|
-
- 0
|
109
|
-
- 10
|
110
|
-
- 0
|
75
|
+
- !ruby/object:Gem::Version
|
111
76
|
version: 0.10.0
|
112
77
|
type: :development
|
113
|
-
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70169324145600
|
114
80
|
description: Extends has_many associations to group scope. For ActiveRecord!
|
115
|
-
email:
|
81
|
+
email:
|
116
82
|
- ken@metaskills.net
|
117
83
|
executables: []
|
118
|
-
|
119
84
|
extensions: []
|
120
|
-
|
121
85
|
extra_rdoc_files: []
|
122
|
-
|
123
|
-
files:
|
86
|
+
files:
|
124
87
|
- .gitignore
|
125
88
|
- .travis.yml
|
126
89
|
- CHANGELOG
|
127
90
|
- Gemfile
|
128
|
-
- Gemfile.rails-3.1
|
129
|
-
- Gemfile.rails-3.2
|
130
91
|
- MIT-LICENSE
|
131
92
|
- README.md
|
132
93
|
- Rakefile
|
@@ -149,38 +110,30 @@ files:
|
|
149
110
|
- test/helper.rb
|
150
111
|
homepage: http://github.com/metaskills/grouped_scope/
|
151
112
|
licenses: []
|
152
|
-
|
153
113
|
post_install_message:
|
154
|
-
rdoc_options:
|
114
|
+
rdoc_options:
|
155
115
|
- --charset=UTF-8
|
156
|
-
require_paths:
|
116
|
+
require_paths:
|
157
117
|
- lib
|
158
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
119
|
none: false
|
160
|
-
requirements:
|
161
|
-
- -
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
|
164
|
-
|
165
|
-
- 0
|
166
|
-
version: "0"
|
167
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ! '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
125
|
none: false
|
169
|
-
requirements:
|
170
|
-
- -
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
|
173
|
-
segments:
|
174
|
-
- 0
|
175
|
-
version: "0"
|
126
|
+
requirements:
|
127
|
+
- - ! '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
176
130
|
requirements: []
|
177
|
-
|
178
131
|
rubyforge_project:
|
179
|
-
rubygems_version: 1.8.
|
132
|
+
rubygems_version: 1.8.17
|
180
133
|
signing_key:
|
181
134
|
specification_version: 3
|
182
135
|
summary: Extends has_many associations to group scope.
|
183
|
-
test_files:
|
136
|
+
test_files:
|
184
137
|
- test/cases/has_many_test.rb
|
185
138
|
- test/cases/has_many_through_test.rb
|
186
139
|
- test/cases/reflection_test.rb
|
data/Gemfile.rails-3.1
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
source :rubygems
|
2
|
-
|
3
|
-
spec = eval File.read('grouped_scope.gemspec')
|
4
|
-
deps = spec.dependencies.map { |dep| {:name => dep.name, :version => dep.requirement.to_s} }
|
5
|
-
|
6
|
-
deps.reject! { |dep| dep[:name] =~ /activerecord/ }
|
7
|
-
deps.each { |dep| gem dep[:name], dep[:version] }
|
8
|
-
|
9
|
-
gem 'activerecord', '~> 3.1.3'
|
data/Gemfile.rails-3.2
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
source :rubygems
|
2
|
-
|
3
|
-
spec = eval File.read('grouped_scope.gemspec')
|
4
|
-
deps = spec.dependencies.map { |dep| {:name => dep.name, :version => dep.requirement.to_s} }
|
5
|
-
|
6
|
-
deps.reject! { |dep| dep[:name] =~ /activerecord/ }
|
7
|
-
deps.each { |dep| gem dep[:name], dep[:version] }
|
8
|
-
|
9
|
-
gem 'activerecord', '3.2.0.rc1'
|