Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol as array index issue with Rails 3.0.X and/or Ruby 1.8.7 #5

Closed
ruckus opened this issue Sep 10, 2011 · 1 comment
Closed

Symbol as array index issue with Rails 3.0.X and/or Ruby 1.8.7 #5

ruckus opened this issue Sep 10, 2011 · 1 comment

Comments

@ruckus
Copy link

ruckus commented Sep 10, 2011

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
Copy link
Owner

ernie commented Sep 10, 2011

See my latest blog post and the readme. You need to use value_of

@ernie ernie closed this as completed Sep 10, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants