I need to duplicate a BLOB field from one table to another, and I want to use an INSERT-SELECT query to achieve this.
INSERT INTO target_table (key, data, comment) SELECT 'my key', data, 'some comment' FROM source_table
Can this be done using the Rails API?
Of course, I could always use ActiveRecord::Base.connection to send my own request to the database, but I hope to find a βRailsβ way to do this. (One that is not related to actually loading data in my Rails application)
ruby-on-rails ruby-on-rails-3
Daniel Rikowski
source share