Module: BallotBox::Base::SingletonMethods
- Defined in:
- lib/ballot_box/base.rb
Instance Method Summary collapse
-
#ballot_box(options = {}) ⇒ Object
ballot_box :counter_cache => true, :strategies => [:authenticated], :place => :position, :scope => :group_id.
Instance Method Details
#ballot_box(options = {}) ⇒ Object
ballot_box :counter_cache => true,
:strategies => [:authenticated],
:place => :position,
:scope => :group_id
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ballot_box/base.rb', line 14 def ballot_box( = {}) extend ClassMethods include InstanceMethods = { :strategies => [:authenticated], :counter_cache => false, :place => false, :refresh => true, :scope => nil } .assert_valid_keys(.keys) = .merge() class_attribute :ballot_box_options, :instance_writer => false self. = has_many :votes, :class_name => 'BallotBox::Vote', :as => :voteable, :dependent => :delete_all attr_accessor :current_vote define_ballot_box_callbacks :vote end |