Sha256: 267de27abac2c4034bbf145cee8b98d016e5aef683ed3a1203556ba953d46807

Contents?: true

Size: 434 Bytes

Versions: 14

Compression:

Stored size: 434 Bytes

Contents

module Ahoy
  module Subscribers
    class ActiveRecord

      def initialize(options = {})
        @model = options[:model] || Ahoy::Event
      end

      def track(name, properties, options = {})
        @model.create! do |e|
          e.visit = options[:visit]
          e.user = options[:user]
          e.name = name
          e.properties = properties
          e.time = options[:time]
        end
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
ahoy_matey-1.1.1 lib/ahoy/subscribers/active_record.rb
ahoy_matey-1.1.0 lib/ahoy/subscribers/active_record.rb
ahoy_matey-1.0.2 lib/ahoy/subscribers/active_record.rb
ahoy_matey-1.0.1 lib/ahoy/subscribers/active_record.rb
ahoy_matey-1.0.0 lib/ahoy/subscribers/active_record.rb
ahoy_matey-0.3.2 lib/ahoy/subscribers/active_record.rb
ahoy_matey-0.3.1 lib/ahoy/subscribers/active_record.rb
ahoy_matey-0.3.0 lib/ahoy/subscribers/active_record.rb
ahoy_matey-0.2.2 lib/ahoy/subscribers/active_record.rb
ahoy_matey-0.2.1 lib/ahoy/subscribers/active_record.rb
ahoy_matey-0.2.0 lib/ahoy/subscribers/active_record.rb
ahoy_events-0.1.1 lib/ahoy/subscribers/active_record.rb
ahoy_events-0.1.0 lib/ahoy/subscribers/active_record.rb
ahoy_events-0.0.2 lib/ahoy/subscribers/active_record.rb