跳至內容 跳至搜尋

Active Record 不觸碰

命名空間
方法
N

實例公開方法

no_touching?()

如果類別設定 no_touching,就會傳回 true,否則為 false

Project.no_touching do
  Project.first.no_touching? # true
  Message.first.no_touching? # false
end
# File activerecord/lib/active_record/no_touching.rb, line 53
def no_touching?
  NoTouching.applied_to?(self.class)
end