lib/metric/rails/controller_methods.rb in metric-0.1.1 vs lib/metric/rails/controller_methods.rb in metric-0.1.2
- old
+ new
@@ -1,7 +1,12 @@
module Metric
module Rails
module ControllerMethods
+ def track_metric(metric, options = {})
+ options[:customer] ||= metric_current_user
+ Metric.track(metric, options)
+ end
+
def metric_current_user
user = current_user
return {} if current_user.nil?
parameters = {}