Sha256: 21c13da45ba21f944d94c3d8f13be60ea714d2fe8f70cbf02e6b9a65ae11884c

Contents?: true

Size: 536 Bytes

Versions: 63

Compression:

Stored size: 536 Bytes

Contents

module Appstats
  class Action < ActiveRecord::Base
    set_table_name "appstats_actions"
    
    attr_accessible :name, :plural_name, :status

    def self.update_actions
      sql = "select distinct(action) from appstats_entries where action not in (select name from appstats_actions)"
      count = 0
      ActiveRecord::Base.connection.execute(sql).each do |row| 
        Appstats::Action.create(:name => row[0], :plural_name => row[0].pluralize, :status => 'derived')
        count += 1
      end
      count
    end
  
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
appstats-0.21.3 lib/appstats/action.rb
appstats-0.21.2 lib/appstats/action.rb
appstats-0.21.1 lib/appstats/action.rb
appstats-0.20.12 lib/appstats/action.rb
appstats-0.20.11 lib/appstats/action.rb
appstats-0.20.10 lib/appstats/action.rb
appstats-0.20.9 lib/appstats/action.rb
appstats-0.20.8 lib/appstats/action.rb
appstats-0.20.7 lib/appstats/action.rb
appstats-0.20.6 lib/appstats/action.rb
appstats-0.20.2 lib/appstats/action.rb
appstats-0.20.1 lib/appstats/action.rb
appstats-0.20.0 lib/appstats/action.rb
appstats-0.19.7 lib/appstats/action.rb
appstats-0.19.6 lib/appstats/action.rb
appstats-0.19.2 lib/appstats/action.rb
appstats-0.19.1 lib/appstats/action.rb
appstats-0.19.0 lib/appstats/action.rb
appstats-0.18.0 lib/appstats/action.rb
appstats-0.17.5 lib/appstats/action.rb