Sha256: ff919053fa6e71132425388aacdeb3446809dda01fc65b37f484f7ee1aee8480
Contents?: true
Size: 631 Bytes
Versions: 10
Compression:
Stored size: 631 Bytes
Contents
module Appstats class ContextValue < ActiveRecord::Base set_table_name "appstats_context_values" establish_connection "appstats_#{Rails.env}" if configurations.keys.include?("appstats_#{Rails.env}") attr_accessible :name, :status def self.update_context_values sql = "select distinct(context_value) from appstats_contexts where context_value not in (select name from appstats_context_values)" count = 0 Appstats.connection.execute(sql).each do |row| Appstats::ContextValue.create(:name => row[0], :status => 'derived') count += 1 end count end end end
Version data entries
10 entries across 10 versions & 1 rubygems