Skip to content

Commit

Permalink
reject update if subject and body are both blank
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdempsey committed May 30, 2012
1 parent 2cc363c commit 2f9a151
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/lists/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class List < ActiveRecord::Base

attr_accessible :body, :position, :subject, :listable, :list_items_attributes

accepts_nested_attributes_for :list_items
accepts_nested_attributes_for :list_items, reject_if: ->(o) {o[:subject].blank? and o[:body].blank?}, allow_destroy: true
end
end

0 comments on commit 2f9a151

Please sign in to comment.