From 13e00df17999857013983051da26a0e15d6f23a5 Mon Sep 17 00:00:00 2001 From: Michael Munroe Date: Mon, 25 Jun 2018 21:26:42 -0400 Subject: Add example for no_touching? in active_record/no_touching for api docs [ci skip] There was no example code for ActiveRecord::NoTouching#no_touching?. This PR adds an example for the API docs. --- activerecord/lib/active_record/no_touching.rb | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.2.3