method
touch_model_timestamps_unless
v6.1.3.1 -
Show latest stable
- Class:
ActiveRecord::InsertAll::Builder
touch_model_timestamps_unless(&block)public
No documentation available.
# File activerecord/lib/active_record/insert_all.rb, line 171
def touch_model_timestamps_unless(&block)
model.send(:timestamp_attributes_for_update_in_model).map do |column_name|
if touch_timestamp_attribute?(column_name)
"#{column_name}=(CASE WHEN (#{updatable_columns.map(&block).join(" AND ")}) THEN #{model.quoted_table_name}.#{column_name} ELSE CURRENT_TIMESTAMP END),"
end
end.compact.join
end