各位好啊
近日在研究怎麼把 Squeel 0.9.5 怎麼來配合我要做的 search from. 按著說明一個個來測試 測到底下的指令就卡住了
我是先在 rails console 底下測。其中有個性別的欄位。它死活就是不讓我過
好生納悶,有誰也有在用 Squeel 幫忙看看 謝謝
Loading development environment (Rails 3.0.7)
ruby-1.9.2-p290 :001 > Student.where{(cname =~ '陳%') & (gender > M) | (cname =~ '陳%') & (gender > F)}
NameError: uninitialized constant M
from (irb):1:in block in irb_binding'
from /home/kojendirect/.rvm/gems/ruby-1.9.2-p290/gems/squeel-0.9.5/lib/squeel/dsl.rb:31:in
instance_eval'
from /home/kojendirect/.rvm/gems/ruby-1.9.2-p290/gems/squeel-0.9.5/lib/squeel/dsl.rb:31:in eval'
from /home/kojendirect/.rvm/gems/ruby-1.9.2-p290/gems/squeel-0.9.5/lib/squeel/adapters/active_record/3.0/relation_extensions.rb:219:in
where'
from /home/kojendirect/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.7/lib/active_record/base.rb:442:in where'
from (irb):1
from /home/kojendirect/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands/console.rb:44:in
start'
from /home/kojendirect/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands/console.rb:8:in start'
from /home/kojendirect/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands.rb:23:in
'
from script/rails:6:in require'
from script/rails:6:in