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 +3 -1
- data/lib/snogmetrics/railtie.rb +3 -3
- metadata +2 -2
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.
|
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
|
data/lib/snogmetrics/railtie.rb
CHANGED
@@ -4,9 +4,9 @@ require 'rails'
|
|
4
4
|
|
5
5
|
module Snogmetrics
|
6
6
|
class Railtie < Rails::Railtie
|
7
|
-
|
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
|