has_dynamic_columns 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a93c0152ec42be40c9f1f46f010e29e4a4ece5f
4
- data.tar.gz: c03f492a592ef25254d1cef1dfbac08b87b4c0dc
3
+ metadata.gz: 6e4bad99fd8958013ac1466934d53fb8be417612
4
+ data.tar.gz: ecf7e132334c6eb87377cd9d3806759b897bf4db
5
5
  SHA512:
6
- metadata.gz: c0dd56561002e2ec02236b795937b500a41c9c83dc3aeb7304a934b393f3bd415be6a25e124cb9ce292653fa783791659774df04efa41d2a9ade8071d402b531
7
- data.tar.gz: 178600b6fcb7d81f3d663113f53b6fb60484c3e63ce9ac566f9b2683230de0cba24c73323643c020eabf722a8b603fe06ebda611e1ed17caf1425acade317a8c
6
+ metadata.gz: 4a0a720d565dadab5182c517a970608d0319f546d38cff0e09f042bf4b1b29d9abb73c1efaa5ea59a777ef6b0bc3a86329ea84c633714c94a390a806a80de9e0
7
+ data.tar.gz: 03cb3fefc739982f2d041cac8205e92edad8d650ab236c39ffb044c52dad4c29d4d72e6d2dd39ce0a6fcea9ce143a53d55068230f4f9f9426da35ab7b28bfd18
@@ -1,3 +1,3 @@
1
1
  module HasDynamicColumns
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -101,6 +101,9 @@ module HasDynamicColumns
101
101
 
102
102
  # Need to join on each of the keys we are performing where on
103
103
  options.each { |key, value|
104
+ # Don't bother with empty values
105
+ next if value.to_s.empty?
106
+
104
107
  column_table = HasDynamicColumns::DynamicColumn.arel_table.alias("dynamic_where_"+key.to_s)
105
108
  column_datum_table = HasDynamicColumns::DynamicColumnDatum.arel_table.alias("dynamic_where_data_"+key.to_s)
106
109
 
@@ -59,6 +59,15 @@ describe HasDynamicColumns do
59
59
 
60
60
  expect(a.customers.dynamic_where(a, { first_name: "Butch" }).length).to eq(1)
61
61
  end
62
+
63
+ it 'should find me with blank value' do
64
+ c = customer
65
+ c.save
66
+ a = c.account
67
+
68
+ expect(a.customers.dynamic_where(a, { first_name: "Butch", last_name: "" }).length).to eq(1)
69
+ end
70
+
62
71
  it 'should return fields as json' do
63
72
  json = customer.as_json(:root => "customer")
64
73
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_dynamic_columns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Butch Marshall