Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more dangerous column names to Rails/DangerousColumnNames #1152

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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