search_scope 0.1.6 → 0.1.7
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/Rakefile +1 -1
- data/lib/search_scope.rb +1 -1
- data/search_scope.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('search_scope', '0.1.
|
5
|
+
Echoe.new('search_scope', '0.1.7') do |p|
|
6
6
|
p.description = "Simplify searching a model by defining custom named_scopes."
|
7
7
|
p.project = 'search-scope'
|
8
8
|
p.url = "http://rubyforge.org/projects/search-scope"
|
data/lib/search_scope.rb
CHANGED
@@ -9,7 +9,7 @@ module SearchScope
|
|
9
9
|
|
10
10
|
def sort_search_by(name, options={})
|
11
11
|
options[:label] ||= name.to_s.titleize
|
12
|
-
options[:order] ||= name.to_s
|
12
|
+
options[:order] ||= "#{table_name}.#{name.to_s}"
|
13
13
|
raise "you must supply a Symbol for a name to new_sortable_by (#{name.inspect})" unless name.is_a? Symbol
|
14
14
|
return if sort_choices_hash.keys.include? name.to_s
|
15
15
|
#the first sort added becomes the default sorting for all searches
|
data/search_scope.gemspec
CHANGED