Permalink
Browse files

update docs to reflect discard_if option

git-svn-id: http://svn.jamesgolick.com/attribute_fu/trunk@65 80b79608-713f-0410-8737-d8c0d0c1b50c
  • Loading branch information...
1 parent c6f0f3c commit 306e39cd78da145f953152bbd9440734d680a6a2 james committed Feb 16, 2008
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/attribute_fu/associations.rb
@@ -79,7 +79,12 @@ module ClassMethods
# Behaves identically to the regular has_many, except adds the option <tt>:attributes</tt>, which, if true, creates
# a method called association_id_attributes (i.e. task_attributes, or comment_attributes) for setting the attributes
- # of a collection of associated models.
+ # of a collection of associated models. It also adds the option <tt>:discard_if</tt>, which accepts a proc. If the proc
+ # evaluates to true, the child model will be discarded.
+ #
+ # e.g.
+ #
+ # :discard_if => proc { |comment| comment.title.blank? }
#
# The format is as follows:
#

0 comments on commit 306e39c

Please sign in to comment.