diff --git a/.byebug_history b/.byebug_history deleted file mode 100644 index 9495d2f..0000000 --- a/.byebug_history +++ /dev/null @@ -1,47 +0,0 @@ -continue -columns -entries.first.changed -continue -entries -continue -entries.first.changes -entries.each { _1.updated_at = Time.current } -continue -self.has_attribute?('updated_at') -continue -c.attributes -c.bitcoin_address = 'abcdefghijkl' -c.attributes -c.encrypt -c.attributes -c.read_attribute(:bitcoin_address) -c.bitcoin_address_after_type_cast -c.bitcoin_address_before_type_cast -c.bitcoin_address_before_typecast -c.bitcoin_address = 'abc' -c = Cat.first -Cat.first -Cat.firsst -Cat.encrypted_attributes -Cat -entries -continue -entries.first.changed? -entries -continue -cat2.changed? -cat1.changed? -continue -cat1.changes -cat2.changed? -cat1.changed? -continue -expected -@actual -continue -puts sql_queries -sql_queries -continue -Cat.columns_hash['name'] -Cat.columns_hash -continue diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 723e7c8..98b349b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -./** @tdeo @quentindemetz +* @tdeo @quentindemetz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e1052c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.byebug_history +*.gem diff --git a/lib/batch_update.rb b/lib/batch_update.rb index 9856e5f..15f58b9 100644 --- a/lib/batch_update.rb +++ b/lib/batch_update.rb @@ -17,13 +17,10 @@ module ClassMethods def batch_update(entries, columns:, batch_size: 100, validate: true) columns = column_names if columns == :all columns = (Array.wrap(columns).map(&:to_s) + %w[updated_at]).uniq - # + ::Auditable::ActiveRecord::AUDIT_LOG_UPDATED_COLUMNS).uniq entries = entries.select { columns.intersect?(_1.changed) } entries.each { _1.updated_at = Time.current } if has_attribute?('updated_at') - entries.each(&:validate!) if validate - # entries.each(&:mark_audit_log_update) primary_keys = Array.wrap(primary_key).map(&:to_s)