aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-06-26 11:17:05 +0900
committerGitHub <noreply@github.com>2018-06-26 11:17:05 +0900
commit43ffbd1fabfc96b42e95906821483aeb401d6b2d (patch)
tree41660229019f88fcd838681576bb15f2ce694fb6
parent56b9d0fd3a281f97463edf556d0f4b6b283d715d (diff)
parent13e00df17999857013983051da26a0e15d6f23a5 (diff)
downloadrails-43ffbd1fabfc96b42e95906821483aeb401d6b2d.tar.gz
rails-43ffbd1fabfc96b42e95906821483aeb401d6b2d.tar.bz2
rails-43ffbd1fabfc96b42e95906821483aeb401d6b2d.zip
Merge pull request #33224 from mikepmunroe/mm-no-touching-api-update
Add example for no_touching? for api docs [ci skip]
-rw-r--r--activerecord/lib/active_record/no_touching.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/no_touching.rb b/activerecord/lib/active_record/no_touching.rb
index 754c891884..697076bdae 100644
--- a/activerecord/lib/active_record/no_touching.rb
+++ b/activerecord/lib/active_record/no_touching.rb
@@ -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