mirror of https://github.com/rails/rails
Remove unused attribute
This commit is contained in:
parent
89123523d2
commit
0f57f75008
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue