Class: ABChoice
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ABChoice
- Defined in:
- lib/ab_choice.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.reset! ⇒ Object
15 16 17 |
# File 'lib/ab_choice.rb', line 15 def self.reset! self.destroy_all end |
.succeed(identity_hash) ⇒ Object
11 12 13 |
# File 'lib/ab_choice.rb', line 11 def self.succeed(identity_hash) self.find_by_identity_hash(identity_hash).success! end |
Instance Method Details
#success! ⇒ Object
5 6 7 8 9 |
# File 'lib/ab_choice.rb', line 5 def success! unless success? update_attributes :success => true, :succeeded_at => DateTime.now end end |