# Default\_scope in rails 3 with lambda

**URL:** <https://www.ruby-forum.com/t/default-scope-in-rails-3-with-lambda/192417>\
**Category:** Rails\
**Created:** [July 29, 2010, 10:55pm UTC](https://www.ruby-forum.com/t/default-scope-in-rails-3-with-lambda/192417 "2010-07-29T22:55:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Alejandro\_Ga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/59ef9b/32.png) [@Daniel\_Alejandro\_Ga](https://www.ruby-forum.com/u/Daniel_Alejandro_Ga)\
**Post date:** [July 29, 2010, 10:55pm UTC](https://www.ruby-forum.com/t/default-scope-in-rails-3-with-lambda/192417/1 "2010-07-29T22:55:26Z")

</div>

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
