Friday, August 17, 2012

Execute SQL statement in Rails


rs = ActiveRecord::Base.connection.execute("select something from sometable")
value = rs[row_id_zero_based]['column_name']

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.