Inheritance ActiveRecord中是否有删除关联的方法?
我有一个Sinatra应用程序,它使用Sidekiq作业标记服务的成员。这是一个模型Inheritance ActiveRecord中是否有删除关联的方法?,inheritance,activerecord,associations,shortcut,Inheritance,Activerecord,Associations,Shortcut,我有一个Sinatra应用程序,它使用Sidekiq作业标记服务的成员。这是一个模型 class TagInstruction < ActiveRecord::Base belongs_to :tag_job end 它应该这样做: undef tag_job undef tag_job= undef build_tag_job undef create_tag_job undef create_tag_job! 也许您可以使用多态关联定义所属对象,如下所示: does_not_b
class TagInstruction < ActiveRecord::Base
belongs_to :tag_job
end
它应该这样做:
undef tag_job
undef tag_job=
undef build_tag_job
undef create_tag_job
undef create_tag_job!
也许您可以使用多态关联定义所属对象,如下所示:
does_not_belong_to :tag_job
undef tag_job
undef tag_job=
undef build_tag_job
undef create_tag_job
undef create_tag_job!