search for: mark_as_paid

Displaying 1 result from an estimated 1 matches for "mark_as_paid".

Did you mean: mark_as_bad
2007 Mar 09
0
New plugin: Flagger
Hi all, I''ve just put out a plugin for ActiveRecord that stops you having to write repetitive bundles of methods such as class Order < ActiveRecord::Base def self.paid find_all_by_paid(true) end def self.unpaid find_all_by_paid(false) end def mark_as_paid update_attribute(:paid, true) # related tasks end def mark_as_unpaid update_attribute(:paid, false) # related tasks end end It gives you dynamic attribute-based methods similar to these. You can use certain negative prefixes to look for false values - Order.u...