Hello,
I want to ask Is there any tool to convet ActiveRecord 2.3.5 statement to sql?
Hello,
I want to ask Is there any tool to convet ActiveRecord 2.3.5 statement to sql?
This may help Ruby on Rails Guides: Active Record Query Interface
what is it you are trying to convert. Do you mean you wish to add a column to your database to store information if so you would use your model and migrations
If it's a one-time or occasional thing, just execute the statement and grab the query SQL from your logs.
There are also `to_sql()` methods in ActiveRecord::Relation and ActiveRecord::ConnectionAdapters::DatabaseStatements which (hint) you could find by searching the docs.
HTH,
Should be able to see the SQL in the debug log if you have it enabled.
For ActiveRecord in Rails 2.3, you can use
.construct_finder_sql({})
tonypm