mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #33224 from mikepmunroe/mm-no-touching-api-update
Add example for no_touching? for api docs [ci skip]
This commit is contained in:
commit
43ffbd1fab
1 changed files with 7 additions and 0 deletions
|
@ -43,6 +43,13 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
|
||||
# Returns +true+ if the class has +no_touching+ set, +false+ otherwise.
|
||||
#
|
||||
# Project.no_touching do
|
||||
# Project.first.no_touching? # true
|
||||
# Message.first.no_touching? # false
|
||||
# end
|
||||
#
|
||||
def no_touching?
|
||||
NoTouching.applied_to?(self.class)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue