snogmetrics 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/snogmetrics.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'snogmetrics/railtie' if defined? Rails::Railtie
2
+
1
3
  # If SNOGmetrics is used as a Rails plugin, this module is automatically mixed
2
4
  # into ActionController::Base, so that it's #km method is available in
3
5
  # controllers and in views.
@@ -14,7 +16,7 @@
14
16
  # the default implementation outputs the real API only when
15
17
  # `Rails.env.production?` is true.
16
18
  module Snogmetrics
17
- VERSION = '0.1.5'
19
+ VERSION = '0.1.6'
18
20
 
19
21
  # Returns an instance of KissmetricsApi, which is an interface to the
20
22
  # KISSmetrics API. It has the methods #record and #identify, which work just
@@ -4,9 +4,9 @@ require 'rails'
4
4
 
5
5
  module Snogmetrics
6
6
  class Railtie < Rails::Railtie
7
- initializer 'my_railtie.configure_rails_initialization' do
8
- ActionController::Base.send(:include, Snogmetrics)
9
- ActionView::Base.send(:include, Snogmetrics)
7
+ config.after_initialize do
8
+ ::ActionController::Base.send(:include, Snogmetrics)
9
+ ::ActionView::Base.send(:include, Snogmetrics)
10
10
  end
11
11
  end
12
12
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Theo Hultberg