scoped-search 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.textile +1 -1
  2. data/VERSION +1 -1
  3. data/lib/scoped_search.rb +6 -2
  4. metadata +4 -4
data/README.textile CHANGED
@@ -24,7 +24,7 @@ You may use it as plugin or as a gem.
24
24
  Edit your Gemfile and add :
25
25
 
26
26
  <pre>
27
- gem 'scoped-search'
27
+ gem 'scoped-search', :require => "scoped_search"
28
28
  </pre>
29
29
 
30
30
  **Plugin**
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
data/lib/scoped_search.rb CHANGED
@@ -53,8 +53,12 @@ class ScopedSearch
53
53
  if record.is_a?(ScopedSearch::Base)
54
54
  options = args.extract_options!
55
55
  options.symbolize_keys!
56
-
57
- options.reverse_merge!({ :url => polymorphic_path(record.model_class), :as => :search })
56
+
57
+ default_model_route = (polymorphic_path(record.model_class) rescue nil)
58
+
59
+ options.reverse_merge!({ :url => default_model_route, :as => :search })
60
+ raise "You have to manually specify :url in your form_for options..." unless options[:url].present?
61
+
58
62
  options[:html] ||= {}
59
63
  options[:html].reverse_merge!({ :method => :get })
60
64
  args << options
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scoped-search
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - slainer68