app/models/cohortly/metric.rb in cohortly-0.0.4 vs app/models/cohortly/metric.rb in cohortly-0.0.5
- old
+ new
@@ -13,15 +13,17 @@
ensure_index :tags
def self.store!(args)
data = args[4]
- if data[:controller] && !data[:controller]['cohortly']
+ data[:tags] = []
+ if data[:controller]
+ return if data[:controller]['cohortly']
data[:tags] = Cohortly::TagConfig.tags_for(data[:controller], data[:action])
- data[:user_email] = data[:email] if data[:email]
- data[:tags] += data[:add_tags] if data[:add_tags]
- create(data)
end
+ data[:user_email] = data[:email] if data[:email]
+ data[:tags] += data[:add_tags] if data[:add_tags]
+ create(data)
end
def self.cohort_chart_for_tag(tags = nil)
query = {}
query = { :tags => { :$all => tags } } if tags