Sha256: a397f8d2237534863010b5dae8f353f220e2f43a1d6503ca6997fc9001c82804

Contents?: true

Size: 521 Bytes

Versions: 44

Compression:

Stored size: 521 Bytes

Contents

module Appstats
  class ContextKey < ActiveRecord::Base
    set_table_name "appstats_context_keys"
    
    attr_accessible :name, :status

    def self.update_context_keys
      sql = "select distinct(context_key) from appstats_contexts where context_key not in (select name from appstats_context_keys)"
      count = 0
      ActiveRecord::Base.connection.execute(sql).each do |row| 
        Appstats::ContextKey.create(:name => row[0], :status => 'derived')
        count += 1
      end
      count
    end
  
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
appstats-0.20.2 lib/appstats/context_key.rb
appstats-0.20.1 lib/appstats/context_key.rb
appstats-0.20.0 lib/appstats/context_key.rb
appstats-0.19.7 lib/appstats/context_key.rb
appstats-0.19.6 lib/appstats/context_key.rb
appstats-0.19.2 lib/appstats/context_key.rb
appstats-0.19.1 lib/appstats/context_key.rb
appstats-0.19.0 lib/appstats/context_key.rb
appstats-0.18.0 lib/appstats/context_key.rb
appstats-0.17.5 lib/appstats/context_key.rb
appstats-0.17.4 lib/appstats/context_key.rb
appstats-0.17.3 lib/appstats/context_key.rb
appstats-0.17.2 lib/appstats/context_key.rb
appstats-0.17.1 lib/appstats/context_key.rb
appstats-0.17.0 lib/appstats/context_key.rb
appstats-0.16.7 lib/appstats/context_key.rb
appstats-0.16.6 lib/appstats/context_key.rb
appstats-0.16.5 lib/appstats/context_key.rb
appstats-0.16.4 lib/appstats/context_key.rb
appstats-0.16.3 lib/appstats/context_key.rb