mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 22:18:06 +01:00
Remove version check from update cache_concern.rb (#27592)
This commit is contained in:
parent
eae5c7334a
commit
33f8c1c5eb
1 changed files with 4 additions and 12 deletions
|
@ -92,19 +92,11 @@ module CacheConcern
|
||||||
arguments
|
arguments
|
||||||
end
|
end
|
||||||
|
|
||||||
if Rails.gem_version >= Gem::Version.new('7.0')
|
|
||||||
def attributes_for_database(record)
|
def attributes_for_database(record)
|
||||||
attributes = record.attributes_for_database
|
attributes = record.attributes_for_database
|
||||||
attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr }
|
attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr }
|
||||||
attributes
|
attributes
|
||||||
end
|
end
|
||||||
else
|
|
||||||
def attributes_for_database(record)
|
|
||||||
attributes = record.instance_variable_get(:@attributes).send(:attributes).transform_values(&:value_for_database)
|
|
||||||
attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr }
|
|
||||||
attributes
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def deserialize_record(class_name, attributes_from_database, new_record = false) # rubocop:disable Style/OptionalBooleanParameter
|
def deserialize_record(class_name, attributes_from_database, new_record = false) # rubocop:disable Style/OptionalBooleanParameter
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Reference in a new issue