Skip to content

Commit

Permalink
changed method name to 'searchable' from 'sunspot_setup'
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Jul 5, 2010
1 parent 0de9160 commit 19bae34
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -20,7 +20,7 @@ Example
field :title

include Sunspot::Mongoid
sunspot_setup do
searchable do
text :title
end
end
Expand Down
2 changes: 1 addition & 1 deletion examples/example.rb
Expand Up @@ -11,7 +11,7 @@ class Post
field :title

include Sunspot::Mongoid
sunspot_setup do
searchable do
text :title
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sunspot/mongoid.rb
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions test/test_sunspot_mongoid.rb
Expand Up @@ -9,7 +9,7 @@ class Foo
field :title

include Sunspot::Mongoid
sunspot_setup do
searchable do
text :title
end
end
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 19bae34

Please sign in to comment.