Fix rubocop violations in AR initializer
Change-Id: I8a4b84177cfcb89ad148c18a7a06149a7117d285 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316758 Reviewed-by: Aaron Ogata <aogata@instructure.com> QA-Review: Isaac Moore <isaac.moore@instructure.com> Product-Review: Isaac Moore <isaac.moore@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
This commit is contained in:
parent
42e55a6553
commit
1c61a27781
|
@ -732,13 +732,13 @@ class ActiveRecord::Base
|
|||
self.created_at = updated_at if touch
|
||||
self.id = self.class._insert_record(
|
||||
attributes_with_values(attribute_names_for_partial_inserts)
|
||||
.transform_values { |attr| attr.is_a?(ActiveModel::Attribute) ? attr.value : attr }
|
||||
.transform_values { |attr| attr.is_a?(ActiveModel::Attribute) ? attr.value : attr }
|
||||
)
|
||||
@new_record = false
|
||||
else
|
||||
update_columns(
|
||||
attributes_with_values(attribute_names_for_partial_updates)
|
||||
.transform_values { |attr| attr.is_a?(ActiveModel::Attribute) ? attr.value : attr }
|
||||
.transform_values { |attr| attr.is_a?(ActiveModel::Attribute) ? attr.value : attr }
|
||||
)
|
||||
end
|
||||
changes_applied
|
||||
|
@ -914,7 +914,7 @@ module UsefulFindInBatches
|
|||
fields = result.fields
|
||||
fields.each_with_index do |fname, i|
|
||||
ftype = result.ftype i
|
||||
fmod = result.fmod i
|
||||
fmod = result.fmod i
|
||||
types[fname] = conn.send(:get_oid_type, ftype, fmod, fname)
|
||||
end
|
||||
|
||||
|
@ -1906,7 +1906,8 @@ end
|
|||
ActiveRecord::Migration.prepend(AlwaysUseMigrationDates)
|
||||
|
||||
module ExplainAnalyze
|
||||
def exec_explain(queries, analyze: false) # :nodoc:
|
||||
def exec_explain(queries, analyze: false)
|
||||
# :nodoc:
|
||||
str = queries.map do |sql, binds|
|
||||
msg = "EXPLAIN #{"ANALYZE " if analyze}for: #{sql}"
|
||||
unless binds.empty?
|
||||
|
|
Loading…
Reference in New Issue