supernova 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/supernova/criteria.rb +3 -0
- data/spec/supernova/criteria_spec.rb +4 -0
- data/supernova.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.5
|
data/lib/supernova/criteria.rb
CHANGED
@@ -126,6 +126,9 @@ class Supernova::Criteria
|
|
126
126
|
if value.is_a?(Hash)
|
127
127
|
reference[key] ||= Hash.new
|
128
128
|
reference[key].merge!(value)
|
129
|
+
elsif key == :select
|
130
|
+
reference[key] ||= Array.new
|
131
|
+
reference[key] += (value || [])
|
129
132
|
else
|
130
133
|
reference[key] = value
|
131
134
|
end
|
@@ -223,6 +223,10 @@ describe "Supernova::Criteria" do
|
|
223
223
|
new_crit.merge(criteria).search_options[:search].should == ["New Search"]
|
224
224
|
end
|
225
225
|
|
226
|
+
it "correctly merges select statements" do
|
227
|
+
Supernova::Criteria.new.select(:title).merge(Supernova::Criteria.new.select(:name)).search_options[:select].should == [:title, :name]
|
228
|
+
end
|
229
|
+
|
226
230
|
it "correctly merges the named_scope_class" do
|
227
231
|
new_crit.named_scope_class(String)
|
228
232
|
new_crit.merge(criteria).search_options[:named_scope_class].should == String
|
data/supernova.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: supernova
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 5
|
10
|
+
version: 0.3.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tobias Schwab
|