1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove unused attribute

This commit is contained in:
George Claghorn 2018-07-21 14:21:14 -04:00
parent 89123523d2
commit 0f57f75008
2 changed files with 5 additions and 5 deletions

View file

@ -6,10 +6,10 @@ module ActiveStorage
# Abstract base class for the concrete ActiveStorage::Attached::One and ActiveStorage::Attached::Many
# classes that both provide proxy access to the blob association for a record.
class Attached
attr_reader :name, :record, :dependent
attr_reader :name, :record
def initialize(name, record, dependent:)
@name, @record, @dependent = name, record, dependent
def initialize(name, record)
@name, @record = name, record
end
private

View file

@ -33,7 +33,7 @@ module ActiveStorage
def has_one_attached(name, dependent: :purge_later)
generated_association_methods.class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{name}
@active_storage_attached_#{name} ||= ActiveStorage::Attached::One.new("#{name}", self, dependent: #{dependent == :purge_later ? ":purge_later" : "false"})
@active_storage_attached_#{name} ||= ActiveStorage::Attached::One.new("#{name}", self)
end
def #{name}=(attachable)
@ -89,7 +89,7 @@ module ActiveStorage
def has_many_attached(name, dependent: :purge_later)
generated_association_methods.class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{name}
@active_storage_attached_#{name} ||= ActiveStorage::Attached::Many.new("#{name}", self, dependent: #{dependent == :purge_later ? ":purge_later" : "false"})
@active_storage_attached_#{name} ||= ActiveStorage::Attached::Many.new("#{name}", self)
end
def #{name}=(attachables)