Symbol as array index issue with Rails 3.0.X and/or Ruby 1.8.7
Closed this issue · 1 comments
ruckus commented
I'm on Ruby 1.8.7 and Rails 3.0.7 and have successfully installed Valium and can boot a console, but:
User.where('id > 0')[:id]
yields:
User Load (2.6ms) SELECT "users".* FROM "users" WHERE (id > 0)
TypeError: Symbol as array index
from /Users/codyc/.rvm/gems/ruby-1.8.7-p352@vinosmith/gems/activerecord-3.0.7/lib/active_record/relation.rb:366:in `[]'
from /Users/codyc/.rvm/gems/ruby-1.8.7-p352@vinosmith/gems/activerecord-3.0.7/lib/active_record/relation.rb:366:in `send'
from /Users/codyc/.rvm/gems/ruby-1.8.7-p352@vinosmith/gems/activerecord-3.0.7/lib/active_record/relation.rb:366:in `method_missing'
from (irb):1
Valium works great on a Ruby 1.9.2 / Rails 3.1 app - but I'd love to use it on this legacy app.
Thanks.
ernie commented
See my latest blog post and the readme. You need to use value_of