Forum: Ruby on Rails Using mysql's 'REPLACE' command in active record

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Richard M. (Guest)
on 2009-03-18 04:25
(Received via mailing list)
Is this possible ??

Many thnaks

Richard
Mark Reginald J. (Guest)
on 2009-03-19 06:30
(Received via mailing list)
Richard wrote:
> Is this possible ??

Yes, but only with custom SQL:

Model.connection.insert "replace into #{Model.table_name} ...."

--
Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com
Richard M. (Guest)
on 2009-03-19 06:34
(Received via mailing list)
Thanks for the reply Mark,

This is as I thought... :(

At least it is sort of do-able, I don't enjoy putting sql in
activerecord but sometimes I guess it is needed...

Cheers

Richard
This topic is locked and can not be replied to.