Skip to content

Commit

Permalink
Merge pull request #1152 from r7kamura/dangerous-column-names
Browse files Browse the repository at this point in the history
Add more dangerous column names to `Rails/DangerousColumnNames`
  • Loading branch information
koic committed Oct 12, 2023
2 parents 5624268 + 971ba43 commit 3629fc9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/change_add_more_dangerous_column_names_to.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#1152](https://github.com/rubocop/rubocop-rails/pull/1152): Add more dangerous column names to `Rails/DangerousColumnNames`. ([@r7kamura][])
10 changes: 9 additions & 1 deletion lib/rubocop/cop/rails/dangerous_column_names.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ class DangerousColumnNames < Base # rubocop:disable Metrics/ClassLength
time
].to_set.freeze

# Generated from `ActiveRecord::AttributeMethods.dangerous_attribute_methods` on activerecord 7.0.5.
# Generated from `ActiveRecord::AttributeMethods.dangerous_attribute_methods` on activerecord 7.1.0.
# rubocop:disable Metrics/CollectionLiteralLength
DANGEROUS_COLUMN_NAMES = %w[
__callbacks
__id__
_assign_attribute
_assign_attributes
_before_commit_callbacks
Expand Down Expand Up @@ -195,11 +196,13 @@ class DangerousColumnNames < Base # rubocop:disable Metrics/ClassLength
changes_to_save
check_record_limit
ciphertext_for
class
clear_attribute_change
clear_attribute_changes
clear_changes_information
clear_timestamp_attributes
clear_transaction_record_state
clone
collection_cache_versioning
column_for_attribute
committed
Expand Down Expand Up @@ -227,6 +230,7 @@ class DangerousColumnNames < Base # rubocop:disable Metrics/ClassLength
destroyed
destroyed_by_association
destroyed_by_association=
dup
each_counter_cached_associations
encode_with
encrypt
Expand All @@ -243,7 +247,9 @@ class DangerousColumnNames < Base # rubocop:disable Metrics/ClassLength
find_parameter_position
forget_attribute_assignments
format_for_inspect
freeze
from_json
frozen?
halted_callback_hook
has_attribute
has_changes_to_save
Expand All @@ -252,6 +258,7 @@ class DangerousColumnNames < Base # rubocop:disable Metrics/ClassLength
has_encrypted_attributes
has_encrypted_rich_texts
has_transactional_callbacks
hash
id
id_before_type_cast
id_for_database
Expand Down Expand Up @@ -283,6 +290,7 @@ class DangerousColumnNames < Base # rubocop:disable Metrics/ClassLength
new_record
no_touching
normalize_reflection_attribute
object_id
partial_inserts
partial_updates
perform_validations
Expand Down

0 comments on commit 3629fc9

Please sign in to comment.