Class: SupplejackApi::SourceActivity
- Inherits:
-
Object
- Object
- SupplejackApi::SourceActivity
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- app/models/supplejack_api/source_activity.rb
Class Method Summary collapse
Class Method Details
.get_source_clicks ⇒ Object
28 29 30 |
# File 'app/models/supplejack_api/source_activity.rb', line 28 def self.get_source_clicks SupplejackApi::SourceActivity.first.try(:source_clicks) end |
.increment ⇒ Object
20 21 22 23 24 25 26 |
# File 'app/models/supplejack_api/source_activity.rb', line 20 def self.increment if first first.inc(source_clicks: 1) else SupplejackApi::SourceActivity.create(source_clicks: 1) end end |
.reset ⇒ Object
32 33 34 |
# File 'app/models/supplejack_api/source_activity.rb', line 32 def self.reset SupplejackApi::SourceActivity.first.try(:delete) end |