>> I get a 'wrong number of arguments' error. I seem to remember that
>> this used to work, am I doing something wrong or has something  
>> changed?
>
> ferret_enabled? takes a boolean argument telling it if there's a bulk
> indexing going on, or if it's a normal update of a single record. So
> in your case, overriding it like that:
>
> def ferret_enabled?(is_bulk_index)
>  is_bulk_index
> end
>
> should do what you want - disable normal index updates, but allow them
> during rebuild and bulk_index calls..


Thanks...

I can update from the console now but I get a 'wrong numbers of  
arguments error' when I add or update a page.

I've added a ferret_enabled? method to the Page model (which  
acts_as_ferret), like this:

def ferret_enabled?(is_bulk_index)
   is_bulk_index
end

But now I get the following error on create or update:

ArgumentError in PagesController#create

wrong number of arguments (0 for 1)
RAILS_ROOT: /Users/jeroen/Documents/projecten/hdz01/trunk/config/..

Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/instance_methods.rb: 
88:in `ferret_enabled?'
#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/instance_methods.rb: 
88:in `ferret_create'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb: 
333:in `send'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb: 
333:in `callback'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb: 
330:in `each'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb: 
330:in `callback'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb: 
255:in `create_without_timestamps'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/timestamp.rb: 
39:in `create'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb: 
1789:in `create_or_update_without_callbacks'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/callbacks.rb: 
242:in `create_or_update'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/base.rb: 
1545:in `save_without_validation'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ 
validations.rb:752:in `save_without_transactions'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ 
transactions.rb:129:in `save'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ 
connection_adapters/abstract/database_statements.rb:59:in `transaction'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ 
transactions.rb:95:in `transaction'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ 
transactions.rb:121:in `transaction'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/active_record/ 
transactions.rb:129:in `save'
#{RAILS_ROOT}/app/controllers/pages_controller.rb:78:in `create'
#{RAILS_ROOT}/app/controllers/pages_controller.rb:77:in `create'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel/rails.rb:76:in  
`process'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel/rails.rb:74:in  
`synchronize'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel/rails.rb:74:in  
`process'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:155:in  
`process_client'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:154:in `each'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:154:in  
`process_client'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:281:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:281:in  
`initialize'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:281:in `new'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:281:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:264:in  
`initialize'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:264:in `new'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel.rb:264:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel/configurator.rb: 
282:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel/configurator.rb: 
281:in `each'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel/configurator.rb: 
281:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:128:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/lib/mongrel/command.rb: 
212:in `run'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:281
/usr/bin/mongrel_rails:16:in `load'
/usr/bin/mongrel_rails:16
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to