search_magic 0.0.4 → 0.0.5

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- search_magic (0.0.3)
4
+ search_magic (0.0.4)
5
5
  mongoid (>= 2.0.0.rc.7)
6
6
 
7
7
  GEM
@@ -34,7 +34,7 @@ module SearchMagic
34
34
  end
35
35
 
36
36
  def arrange(arrangeable, direction = :asc)
37
- arrangeable.blank? || !searchables.keys.include?(arrangeable) ? criteria : order_by(["arrangeable_values.#{arrangeable}", direction])
37
+ arrangeable.blank? || !searchables.keys.include?(arrangeable) ? criteria : order_by([["arrangeable_values.#{arrangeable}", direction]])
38
38
  end
39
39
 
40
40
  private
@@ -1,3 +1,3 @@
1
1
  module SearchMagic
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -61,7 +61,13 @@ describe SearchMagic::FullTextSearch do
61
61
  subject { Asset.arrange(:title) }
62
62
  it { should be_a(Mongoid::Criteria) }
63
63
  its(:options) { should_not be_empty }
64
- its(:options) { should include(:sort => ["arrangeable_values.title", :asc]) }
64
+ its(:options) { should include(:sort => [["arrangeable_values.title", :asc]]) }
65
+ end
66
+
67
+ context "when arranging a model on multiple searchables" do
68
+ subject { Asset.arrange(:title).arrange(:tag) }
69
+ it { should be_a(Mongoid::Criteria) }
70
+ its(:options) { should include(:sort => [["arrangeable_values.title", :asc], ["arrangeable_values.tag", :asc]]) }
65
71
  end
66
72
 
67
73
  shared_examples_for "arranged assets" do |arrangeable, direction, expected_order|
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Joshua Bowers