Permalink
Browse files

Moved squawk method into LocalInstanceMethods module, so it would

not be added to every ActiveRecord::Base object.  Changed acts_as_yaffle
so it will include the LocalInstanceMethods module.  Now only
models that call acts_as_yaffle will get the squawk method, instead
of pushing them into every ActiveRecord::Base.
  • Loading branch information...
mulvaney committed Mar 16, 2012
1 parent 2dd486c commit f820098f9ef8fe6e1a5f188d01c3eb2586c5546e
Showing with 6 additions and 3 deletions.
  1. +6 −3 railties/guides/source/plugins.textile
@@ -362,13 +362,16 @@ module Yaffle
def acts_as_yaffle(options = {})
cattr_accessor :yaffle_text_field
self.yaffle_text_field = (options[:yaffle_text_field] || :last_squawk).to_s
+
+ include Yaffle::ActsAsYaffle::LocalInstanceMethods
end
end
- def squawk(string)
- write_attribute(self.class.yaffle_text_field, string.to_squawk)
+ module LocalInstanceMethods
+ def squawk(string)
+ write_attribute(self.class.yaffle_text_field, string.to_squawk)
+ end
end
-
end
end

0 comments on commit f820098

Please sign in to comment.