Class: Ahoy::Subscribers::ActiveRecord
- Inherits:
-
Object
- Object
- Ahoy::Subscribers::ActiveRecord
- Defined in:
- lib/ahoy/subscribers/active_record.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ActiveRecord
constructor
A new instance of ActiveRecord.
- #track(name, properties, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ActiveRecord
Returns a new instance of ActiveRecord.
4 5 6 |
# File 'lib/ahoy/subscribers/active_record.rb', line 4 def initialize( = {}) @model = [:model] || Ahoy::Event end |
Instance Method Details
#track(name, properties, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/ahoy/subscribers/active_record.rb', line 8 def track(name, properties, = {}) @model.create! do |e| e.visit = [:visit] e.user = [:user] e.name = name e.properties = properties e.time = [:time] end end |