1
0
Fork 0
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:
Ryuta Kamizono 2018-06-26 11:17:05 +09:00 committed by GitHub
commit 43ffbd1fab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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