0
0
Fork 0

Enable Rails 7.1 Marshalling format (#28609)

This commit is contained in:
Jean Boussier 2024-01-05 22:57:47 +01:00 committed by GitHub
parent 12bed81187
commit 5a6d533c53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 180 deletions

View file

@ -17,23 +17,8 @@
class CustomFilter < ApplicationRecord
self.ignored_columns += %w(whole_word irreversible)
# NOTE: We previously used `alias_attribute` but this does not play nicely
# with cache
def title
phrase
end
def title=(value)
self.phrase = value
end
def filter_action
action
end
def filter_action=(value)
self.action = value
end
alias_attribute :title, :phrase
alias_attribute :filter_action, :action
VALID_CONTEXTS = %w(
home

View file

@ -17,15 +17,7 @@ class CustomFilterKeyword < ApplicationRecord
validates :keyword, presence: true
# NOTE: We previously used `alias_attribute` but this does not play nicely
# with cache
def phrase
keyword
end
def phrase=(value)
self.keyword = value
end
alias_attribute :phrase, :keyword
before_save :prepare_cache_invalidation!
before_destroy :prepare_cache_invalidation!