On Oct 18, 7:34 am, Greg Willits <[email protected]>
wrote:
> Rails 2.3.2, MySQL 5.0.67, mysql-ruby 2.7, ruby 1.8.6
>
> I am using AR.base.connection.execute to handle a particular case where
> I want to avoid all AR callbacks and optimistic versioning.
>
> When the code is run, the query statement, an update, makes no changes
> to the intended record.
>
Does your code look like this :
m = Model.find(...)
AR::Base.connection.execute(...)
m.reload
?
Does it work if you paste it into script/console ?
If so I'd guess that Rails' query cache is the problem. If so,
changing AR::Base.connection.execute to AR::Base.connection.update
would fix this
Fred
> There are no complaints from Rails as to any errors (I've disabled the
> begin/rescue wrapper), log lines before & after the statement are
> recorded just fine, and the query itself is logged in Dev mode exactly
> as I expect it to read. If I copy the statement from the log and paste
> it to a MySQL GUI to execute, the statement works as expected.
>
> I've poked & poked, but at this point, I can't even think of how to
> debug this.
>
> Thx in advance for any ideas to kickstart my brain in a new direction...
>
> -- gw
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---