Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed method name to 'searchable' from 'sunspot_setup'

  • Loading branch information...
commit 19bae34936370e44d0557141f40bcce002eb0ece 1 parent 0de9160
jugyo authored
2  README.md
View
@@ -20,7 +20,7 @@ Example
field :title
include Sunspot::Mongoid
- sunspot_setup do
+ searchable do
text :title
end
end
2  examples/example.rb
View
@@ -11,7 +11,7 @@ class Post
field :title
include Sunspot::Mongoid
- sunspot_setup do
+ searchable do
text :title
end
end
2  lib/sunspot/mongoid.rb
View
@@ -15,7 +15,7 @@ def self.included(base)
extend Sunspot::Rails::Searchable::ClassMethods
include Sunspot::Rails::Searchable::InstanceMethods
- def self.sunspot_setup(options = {}, &block)
+ def self.searchable(options = {}, &block)
Sunspot.setup(self, &block)
class_inheritable_hash :sunspot_options
8 test/test_sunspot_mongoid.rb
View
@@ -9,7 +9,7 @@ class Foo
field :title
include Sunspot::Mongoid
- sunspot_setup do
+ searchable do
text :title
end
end
@@ -19,7 +19,7 @@ class Bar
field :title
include Sunspot::Mongoid
- sunspot_setup(:auto_index => false, :auto_remove => false) do
+ searchable(:auto_index => false, :auto_remove => false) do
text :title
end
end
@@ -30,9 +30,9 @@ class Bar
assert Bar.sunspot_options == {:auto_index=>false, :auto_remove=>false, :include=>[]}
end
- should 'be called Sunspot.setup when call Foo.sunspot_setup' do
+ should 'be called Sunspot.setup when call Foo.searchable' do
mock(Sunspot).setup(Foo)
- Foo.sunspot_setup
+ Foo.searchable
end
should 'get as text_fields from Sunspot::Setup' do
Please sign in to comment.
Something went wrong with that request. Please try again.