Ruby on Rails Thursday, July 29, 2010

Hello,

i am trying to set a default scope so I can pass a proc as argument. This is the code:

default_scope lambda { where("language = ?", I18n.locale.to_s) }

When I try to get the values, the following error is raised:

NoMethodError: undefined method `includes_values' for #<Proc:0xb6d85b9c>
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activerecord-3.0.0.beta4/lib/active_record/relation/spawn_methods.rb:10:in `send'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activerecord-3.0.0.beta4/lib/active_record/relation/spawn_methods.rb:10:in `merge'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activerecord-3.0.0.beta4/lib/active_record/relation/spawn_methods.rb:9:in `each'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activerecord-3.0.0.beta4/lib/active_record/relation/spawn_methods.rb:9:in `merge'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activerecord-3.0.0.beta4/lib/active_record/base.rb:984:in `construct_finder_arel'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activerecord-3.0.0.beta4/lib/active_record/base.rb:1193:in `default_scope'
    from /home/daniel/projects/ci_conferencer/app/models/speaker.rb:15
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:418:in `load'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:418:in `load_file'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:554:in `new_constants_in'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:417:in `load_file'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:313:in `require_or_load'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:455:in `load_missing_constant'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:156:in `const_missing'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:154:in `each'
    from /home/daniel/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:154:in `const_missing'

Does anybody know how to deal with this problem? has this issue been fixed?

I have googled it but I haven't found any solution =S help me please.

Daniel Alejandro Gaytán Valencia

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment