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.16.2 lib/appstats/context_key.rb
appstats-0.16.1 lib/appstats/context_key.rb
appstats-0.15.1 lib/appstats/context_key.rb
appstats-0.15.0 lib/appstats/context_key.rb
appstats-0.14.0 lib/appstats/context_key.rb
appstats-0.13.4 lib/appstats/context_key.rb
appstats-0.13.3 lib/appstats/context_key.rb
appstats-0.13.2 lib/appstats/context_key.rb
appstats-0.13.1 lib/appstats/context_key.rb
appstats-0.13.0 lib/appstats/context_key.rb
appstats-0.12.5 lib/appstats/context_key.rb
appstats-0.12.4 lib/appstats/context_key.rb
appstats-0.12.2 lib/appstats/context_key.rb
appstats-0.12.1 lib/appstats/context_key.rb
appstats-0.11.7 lib/appstats/context_key.rb
appstats-0.11.6 lib/appstats/context_key.rb
appstats-0.11.5 lib/appstats/context_key.rb
appstats-0.11.4 lib/appstats/context_key.rb
appstats-0.11.3 lib/appstats/context_key.rb
appstats-0.11.2 lib/appstats/context_key.rb