You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These warnings are popping up in the tests and I've isolated it to this method:
define_singleton_method :update_all_with_touch do |updates|
record = new
attrs = record.send(:timestamp_attributes_for_update_in_model)
now = record.send(:current_time_from_proper_timezone)
query = attrs.map { |attr| "#{connection.quote_column_name(attr)} = :now" }
query.push updates
query = query.join(", ")
update_all([query, now: now])
end
Basically we end up with multiple copies of :now in the string but are only passing the one now: now into the update_all. I believe this might be a deeper rails bug but we could alleviate it possibly by naming each :now uniquely and passing all of those now's by name in as a hash.
Alternatively, is there a way to do all of this without resorting to string concatenation? Can't we build up the query as a hash and pass it in?
The text was updated successfully, but these errors were encountered:
These warnings are popping up in the tests and I've isolated it to this method:
Basically we end up with multiple copies of
:now
in the string but are only passing the onenow: now
into theupdate_all
. I believe this might be a deeper rails bug but we could alleviate it possibly by naming each:now
uniquely and passing all of thosenow
's by name in as a hash.Alternatively, is there a way to do all of this without resorting to string concatenation? Can't we build up the query as a hash and pass it in?
The text was updated successfully, but these errors were encountered: