Sha256: 8520659ea98dc632c2f38ad4919a1c5debaeeabdb111941b28eca9a0616120dd

Contents?: true

Size: 444 Bytes

Versions: 25

Compression:

Stored size: 444 Bytes

Contents

class PolyImage < ActiveRecord::Base
  belongs_to :imageable, polymorphic: true
  counter_culture :imageable
  counter_culture :imageable, column_name: 'poly_images_count_dup'
  counter_culture :imageable, column_name: ->(i){i.special? ? 'special_poly_images_count' : nil },
    column_names: {
        ["poly_images.url LIKE ?", '%special%'] => 'special_poly_images_count',
    }


  def special?
    url && url.include?('special')
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
counter_culture-2.2.2 spec/models/poly_image.rb
counter_culture-2.2.1 spec/models/poly_image.rb
counter_culture-2.2.0 spec/models/poly_image.rb
counter_culture-2.1.4 spec/models/poly_image.rb
counter_culture-2.1.3 spec/models/poly_image.rb
counter_culture-2.1.2 spec/models/poly_image.rb
counter_culture-2.1.1 spec/models/poly_image.rb
counter_culture-2.1.0 spec/models/poly_image.rb
counter_culture-2.0.1 spec/models/poly_image.rb
counter_culture-2.0.0 spec/models/poly_image.rb
counter_culture-1.12.0 spec/models/poly_image.rb
counter_culture-1.11.0 spec/models/poly_image.rb
counter_culture-1.10.0 spec/models/poly_image.rb
counter_culture-1.9.2 spec/models/poly_image.rb
counter_culture-1.9.1 spec/models/poly_image.rb
counter_culture-1.9.0 spec/models/poly_image.rb
counter_culture-1.8.2 spec/models/poly_image.rb
counter_culture-1.8.1 spec/models/poly_image.rb
counter_culture-1.8.0 spec/models/poly_image.rb
counter_culture-1.7.0 spec/models/poly_image.rb