提交 0d7ab973 编写于 作者: Y yuuji.yaginuma

Remove unused classes

* `HasManyThroughCantDissociateNewRecords` and `HasManyThroughCantAssociateNewRecords`
are no longer used since f6b12c11.
* `ReadOnlyAssociation` is no longer used since 0da426be.
上级 aa6bcbba
......@@ -140,26 +140,6 @@ class HasManyThroughCantAssociateThroughHasOneOrManyReflection < ThroughCantAsso
class HasOneThroughCantAssociateThroughHasOneOrManyReflection < ThroughCantAssociateThroughHasOneOrManyReflection #:nodoc:
end
class HasManyThroughCantAssociateNewRecords < ActiveRecordError #:nodoc:
def initialize(owner = nil, reflection = nil)
if owner && reflection
super("Cannot associate new records through '#{owner.class.name}##{reflection.name}' on '#{reflection.source_reflection.class_name rescue nil}##{reflection.source_reflection.name rescue nil}'. Both records must have an id in order to create the has_many :through record associating them.")
else
super("Cannot associate new records.")
end
end
end
class HasManyThroughCantDissociateNewRecords < ActiveRecordError #:nodoc:
def initialize(owner = nil, reflection = nil)
if owner && reflection
super("Cannot dissociate new records through '#{owner.class.name}##{reflection.name}' on '#{reflection.source_reflection.class_name rescue nil}##{reflection.source_reflection.name rescue nil}'. Both records must have an id in order to delete the has_many :through record associating them.")
else
super("Cannot dissociate new records.")
end
end
end
class ThroughNestedAssociationsAreReadonly < ActiveRecordError #:nodoc:
def initialize(owner = nil, reflection = nil)
if owner && reflection
......@@ -189,16 +169,6 @@ def initialize(reflection = nil)
end
end
class ReadOnlyAssociation < ActiveRecordError #:nodoc:
def initialize(reflection = nil)
if reflection
super("Cannot add to a has_many :through association. Try adding to #{reflection.through_reflection.name.inspect}.")
else
super("Read-only reflection error.")
end
end
end
# This error is raised when trying to destroy a parent instance in N:1 or 1:1 associations
# (has_many, has_one) when there is at least 1 child associated instance.
# ex: if @project.tasks.size > 0, DeleteRestrictionError will be raised when trying to destroy @project
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册