has_dynamic_columns 0.0.3 → 0.0.4
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.rb +1 -1
- data/lib/has_dynamic_columns/version.rb +1 -1
- data/spec/has_dynamic_columns_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39e5eb44c24247b1b6b2bd23eef9950f73d06954
|
4
|
+
data.tar.gz: b67d157f05f56617c7c9fe4cb8d74a64fb781c53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f5ffd8504ae8bc64e775119ec8b7c967e8186faf60c44414dc51ff072e3e0f790cd06f9b9c2642227b2ae562a24c4cd870b6e792ca8ff205a006da0c6c4b74b
|
7
|
+
data.tar.gz: c90bc7f0c510690e168ad8caff93ae2416ee466be0c981b288ef4ad76b182de8e078e06eb59fe09ad0d74b344471a13927f88f92361f355da6b98bbef4bde200
|
data/lib/has_dynamic_columns.rb
CHANGED
@@ -120,7 +120,7 @@ module HasDynamicColumns
|
|
120
120
|
)
|
121
121
|
|
122
122
|
column_table_join = table.create_join(column_table, column_table_join_on)
|
123
|
-
query = (query.nil?)? joins(column_table_join) : query.
|
123
|
+
query = (query.nil?)? joins(column_table_join) : query.joins(column_table_join)
|
124
124
|
|
125
125
|
# Join on all the data with the provided key
|
126
126
|
column_table_datum_join_on = column_datum_table
|
@@ -68,6 +68,14 @@ describe HasDynamicColumns do
|
|
68
68
|
expect(a.customers.dynamic_where(a, { first_name: "Butch", last_name: "" }).length).to eq(1)
|
69
69
|
end
|
70
70
|
|
71
|
+
it 'should find me by first and last name' do
|
72
|
+
c = customer
|
73
|
+
c.save
|
74
|
+
a = c.account
|
75
|
+
|
76
|
+
expect(a.customers.dynamic_where(a, { first_name: "Butch", last_name: "Marshall" }).length).to eq(1)
|
77
|
+
end
|
78
|
+
|
71
79
|
it 'should return fields as json' do
|
72
80
|
json = customer.as_json(:root => "customer")
|
73
81
|
|