Sha256: 2c1535b609f243b5900de9e5fee2964620db4ae1f5af74eb19c6e7a9841d44d1

Contents?: true

Size: 354 Bytes

Versions: 76

Compression:

Stored size: 354 Bytes

Contents

module Ish::PremiumItem

  def self.included base
    base.send :field, :premium_tier, type: Integer, default: 0 # how many stars need to spend, to get access? 0 = free
    base.send :has_many, :premium_purchases, class_name: '::Gameui::PremiumPurchase', as: :item
  end

  def is_premium
    premium_tier > 0
  end
  def premium?; is_premium; end

end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
ish_models-0.0.33.199 lib/ish/premium_item.rb
ish_models-0.0.33.198 lib/ish/premium_item.rb
ish_models-0.0.33.197 lib/ish/premium_item.rb
ish_models-0.0.33.196 lib/ish/premium_item.rb
ish_models-0.0.33.195 lib/ish/premium_item.rb
ish_models-0.0.33.194 lib/ish/premium_item.rb
ish_models-0.0.33.193 lib/ish/premium_item.rb
ish_models-0.0.33.192 lib/ish/premium_item.rb
ish_models-0.0.33.191 lib/ish/premium_item.rb
ish_models-0.0.33.190 lib/ish/premium_item.rb
ish_models-0.0.33.189 lib/ish/premium_item.rb
ish_models-0.0.33.188 lib/ish/premium_item.rb
ish_models-0.0.33.187 lib/ish/premium_item.rb
ish_models-0.0.33.186 lib/ish/premium_item.rb
ish_models-0.0.33.185 lib/ish/premium_item.rb
ish_models-0.0.33.184 lib/ish/premium_item.rb
ish_models-0.0.33.183 lib/ish/premium_item.rb
ish_models-0.0.33.182 lib/ish/premium_item.rb
ish_models-0.0.33.181 lib/ish/premium_item.rb
ish_models-0.0.33.180 lib/ish/premium_item.rb