Sha256: bf3475abae0276e44591cc2e0dc8336972db93b88ff59ac436b41bc8e4d2af45

Contents?: true

Size: 1.29 KB

Versions: 20

Compression:

Stored size: 1.29 KB

Contents

class Review < ActiveRecord::Base
  belongs_to :user
  belongs_to :product

  counter_culture :product, :touch => true
  counter_culture :product, :column_name => 'rexiews_count'
  counter_culture :user
  counter_culture :user, :column_name => Proc.new { |model| model.review_type ? "#{model.review_type}_count" : nil }, :column_names => {"reviews.review_type = 'using'" => 'using_count', "reviews.review_type = 'tried'" => 'tried_count'}
  counter_culture :user, :column_name => 'review_approvals_count', :delta_column => 'approvals'
  counter_culture :user, :column_name => 'review_value_sum', :delta_column => 'value'
  counter_culture [:user, :manages_company]
  counter_culture [:user, :manages_company], :column_name => 'review_approvals_count', :delta_column => 'approvals'
  counter_culture [:user, :manages_company, :industry]
  counter_culture [:user, :manages_company, :industry], :column_name => 'rexiews_count'
  counter_culture [:user, :manages_company, :industry], :column_name => Proc.new { |model| model.review_type ? "#{model.review_type}_count" : nil }
  counter_culture [:user, :manages_company, :industry], :column_name => 'review_approvals_count', :delta_column => 'approvals'

  after_create :update_some_text

  def update_some_text
    update_attribute(:some_text, rand(36**12).to_s(36))
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
counter_culture-0.2.0 spec/models/review.rb
counter_culture-0.1.34 spec/models/review.rb
counter_culture-0.1.33 spec/models/review.rb
counter_culture-0.1.32 spec/models/review.rb
counter_culture-0.1.31 spec/models/review.rb
counter_culture-0.1.30 spec/models/review.rb
counter_culture-0.1.29 spec/models/review.rb
counter_culture-0.1.28 spec/models/review.rb
counter_culture-0.1.27 spec/models/review.rb
counter_culture-0.1.26 spec/models/review.rb
counter_culture-0.1.25 spec/models/review.rb
counter_culture-0.1.24 spec/models/review.rb
counter_culture-0.1.23 spec/models/review.rb
counter_culture-0.1.22 spec/models/review.rb
counter_culture-0.1.21 spec/models/review.rb
counter_culture-0.1.20 spec/models/review.rb
counter_culture-0.1.19 spec/models/review.rb
counter_culture-0.1.18 spec/models/review.rb
counter_culture-0.1.17 spec/models/review.rb
counter_culture-0.1.16 spec/models/review.rb