Hi Linus

Can you share your define_index blocks for these models?

-- 
Pat

On 16/08/2011, at 6:58 AM, Linus Oleander wrote:

> I can't save any model that I have been indexed by TS.
> 
> Movie.first.save!
> 
>    ArgumentError: wrong number of arguments (0 for 1..3)
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/attribute.rb:197:in
> `initialize'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/attribute.rb:197:in `open'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/attribute.rb:197:in
> `live_value'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:37:in `block in attribute_values_for_index'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:36:in `each'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:36:in `inject'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:36:in `attribute_values_for_index'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:17:in `block in update_attribute_values'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:16:in `each'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:16:in `update_attribute_values'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activesupport-3.1.0.rc5/lib/active_support/callbacks.rb:428:in
> `_run_save_callbacks'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activesupport-3.1.0.rc5/lib/active_support/callbacks.rb:81:in
> `run_callbacks'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/callbacks.rb:264:in
> `create_or_update'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/persistence.rb:57:in `save!'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/validations.rb:56:in `save!'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/attribute_methods/dirty.rb:
> 33:in `save!'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:246:in `block
> in save!'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:295:in `block
> in with_transaction_returning_status'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/connection_adapters/abstract/
> database_statements.rb:183:in `transaction'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:208:in
> `transaction'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:293:in
> `with_transaction_returning_status'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:246:in
> `save!'
>       from (irb):7
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> railties-3.1.0.rc5/lib/rails/commands/console.rb:45:in `start'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> railties-3.1.0.rc5/lib/rails/commands/console.rb:8:in `start'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> railties-3.1.0.rc5/lib/rails/commands.rb:40:in `<top (required)>'
>       from script/rails:6:in `require'
>       from script/rails:6:in `<main>'>>
> 
> Actor.first.save!
> 
>    NoMethodError: undefined method `id' for #<Enumerator:
> 0x00000105b2d800>
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/attribute.rb:197:in
> `live_value'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:37:in `block in attribute_values_for_index'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:36:in `each'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:36:in `inject'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:36:in `attribute_values_for_index'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:17:in `block in update_attribute_values'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:16:in `each'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/bundler/gems/thinking-
> sphinx-2c9a5e2e9055/lib/thinking_sphinx/active_record/
> attribute_updates.rb:16:in `update_attribute_values'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activesupport-3.1.0.rc5/lib/active_support/callbacks.rb:401:in
> `_run_save_callbacks'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activesupport-3.1.0.rc5/lib/active_support/callbacks.rb:81:in
> `run_callbacks'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/callbacks.rb:264:in
> `create_or_update'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/persistence.rb:57:in `save!'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/validations.rb:56:in `save!'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/attribute_methods/dirty.rb:
> 33:in `save!'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:246:in `block
> in save!'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:295:in `block
> in with_transaction_returning_status'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/connection_adapters/abstract/
> database_statements.rb:183:in `transaction'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:208:in
> `transaction'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:293:in
> `with_transaction_returning_status'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> activerecord-3.1.0.rc5/lib/active_record/transactions.rb:246:in
> `save!'
>       from (irb):8
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> railties-3.1.0.rc5/lib/rails/commands/console.rb:45:in `start'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> railties-3.1.0.rc5/lib/rails/commands/console.rb:8:in `start'
>       from /Users/linus/.rvm/gems/ruby-1.9.2-p136/gems/
> railties-3.1.0.rc5/lib/rails/commands.rb:40:in `<top (required)>'
>       from script/rails:6:in `require'
>       from script/rails:6:in `<main>'>>
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/thinking-sphinx?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to