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.
Ad97d898eefbb44ba50c07ee8554781b?d=identicon&s=25 Richard Mcintyre (mackstar)
on 2009-03-18 03:25
(Received via mailing list)
Is this possible ??

Many thnaks

Richard
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2009-03-19 05: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
Ad97d898eefbb44ba50c07ee8554781b?d=identicon&s=25 Richard Mcintyre (mackstar)
on 2009-03-19 05: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.