Event Attribute plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install svn://svn.roundhaus.com/daikini/plugins/event_attribute
class Referral < ActiveRecord::Base event_attribute :applied_at, :attribute => 'pending', :nil_equals => true event_attribute :subscribed_on end referral = Referral.create(:applied_at => Time.now) referral.pending? # => false referral.subscribed? # => false referral.pending = true referral.applied_at # => nil referral.pending? # => true referral.subscribed = true referral.subscribed_at # => Time.now referral.subscribed? # => true # Dynamic finders are also added so that you can search on these boolean attributes. Referral.find_all_by_pending(true) # => [Referral objects] # or Referral.find_by_name_and_pending_and_subscribed('John Smith', false, true) # => Referral object
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, 7 months ago

