Sha256: 73e93d2dcb8fce8f601da31d9caab066187e80c9ee97bd560767ddb3c2811c59

Contents?: true

Size: 508 Bytes

Versions: 18

Compression:

Stored size: 508 Bytes

Contents

module Appstats
  class SubResult < ActiveRecord::Base
    set_table_name "appstats_sub_results"

    attr_accessible :context_filter, :count, :ratio_of_total
    belongs_to :result, :foreign_key => "appstats_result_id"

    def total_count
      return 0 if result.nil?
      result.count
    end

    def ==(o)
       o.class == self.class && o.send(:state) == state
    end
    alias_method :eql?, :==

    private

      def state
        [context_filter, count, ratio_of_total]
      end

    
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
appstats-0.19.0 lib/appstats/sub_result.rb
appstats-0.18.0 lib/appstats/sub_result.rb
appstats-0.17.5 lib/appstats/sub_result.rb
appstats-0.17.4 lib/appstats/sub_result.rb
appstats-0.17.3 lib/appstats/sub_result.rb
appstats-0.17.2 lib/appstats/sub_result.rb
appstats-0.17.1 lib/appstats/sub_result.rb
appstats-0.17.0 lib/appstats/sub_result.rb
appstats-0.16.7 lib/appstats/sub_result.rb
appstats-0.16.6 lib/appstats/sub_result.rb
appstats-0.16.5 lib/appstats/sub_result.rb
appstats-0.16.4 lib/appstats/sub_result.rb
appstats-0.16.3 lib/appstats/sub_result.rb
appstats-0.16.2 lib/appstats/sub_result.rb
appstats-0.16.1 lib/appstats/sub_result.rb
appstats-0.15.1 lib/appstats/sub_result.rb
appstats-0.15.0 lib/appstats/sub_result.rb
appstats-0.14.0 lib/appstats/sub_result.rb