has_dynamic_columns 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/has_dynamic_columns/active_record/v3/query_methods.rb +1 -1
- data/lib/has_dynamic_columns/active_record/v4/query_methods.rb +1 -1
- data/lib/has_dynamic_columns/version.rb +1 -1
- data/spec/has_dynamic_columns/active_record/query_methods_spec.rb +9 -0
- data/spec/has_dynamic_columns/dynamic_columns_string_datum_spec.rb +1 -3
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f728b40892f557858d9809deb92fe4f6c80e54a
|
4
|
+
data.tar.gz: f8c151d8a22042bfb7803be46dce5aefd06600a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a73f110f7ea4dd8e4509e9cb62b53016976e4cdf98286511e5ccd8fa09fe939b1535e829ef561179fc46c87d36fc084c53abf2bdc1fa6cbba19c5aa4977e382
|
7
|
+
data.tar.gz: a186cb3ab5e69896847bb6e91a8f291435680547d1013fae4c76b189642f12714f0cd7c95cfacb893bf81d460d4fd871623733b98b1d1db8039cf695756b2ddf
|
@@ -202,7 +202,7 @@ module HasDynamicColumns
|
|
202
202
|
chain = ::ActiveRecord::QueryMethods::WhereChain.new(scope)
|
203
203
|
chain.send(:extend, WhereChainCompatibility)
|
204
204
|
else
|
205
|
-
where_without_dynamic_columns(opts, rest)
|
205
|
+
where_without_dynamic_columns(opts, *rest)
|
206
206
|
end
|
207
207
|
end
|
208
208
|
|
@@ -42,6 +42,7 @@ describe ::HasDynamicColumns::ActiveRecord::QueryMethods do
|
|
42
42
|
}
|
43
43
|
customer.save
|
44
44
|
end
|
45
|
+
|
45
46
|
context 'Customer' do
|
46
47
|
it 'should order by first_name' do
|
47
48
|
table = Customer.arel_table
|
@@ -249,4 +250,12 @@ describe ::HasDynamicColumns::ActiveRecord::QueryMethods do
|
|
249
250
|
expect(result).to eq([["1", 30, "Butch", "Casidy"], ["2", 30, "Butch", "Marshall"], ["1", 10, "George", "Marshall"]])
|
250
251
|
end
|
251
252
|
end
|
253
|
+
|
254
|
+
context 'ActiveRecord' do
|
255
|
+
it 'should not clobber where IN queries' do
|
256
|
+
sql = Account.where("id IN (?)", [1,2,3]).to_sql
|
257
|
+
expect(sql).to eq('SELECT "accounts".* FROM "accounts" WHERE (id IN (1,2,3))')
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
252
261
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -31,7 +31,7 @@ require "generators/has_dynamic_columns/templates/migration"
|
|
31
31
|
require "generators/has_dynamic_columns/templates/migration_0.3.0"
|
32
32
|
ActiveRecord::Schema.define do
|
33
33
|
AddHasDynamicColumns.up
|
34
|
-
|
34
|
+
Upgrade030HasDynamicColumns.up
|
35
35
|
|
36
36
|
create_table :accounts, force: true do |t|
|
37
37
|
t.string :name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_dynamic_columns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Butch Marshall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|