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.222 lib/ish/premium_item.rb
ish_models-0.0.33.221 lib/ish/premium_item.rb
ish_models-0.0.33.219 lib/ish/premium_item.rb
ish_models-0.0.33.217 lib/ish/premium_item.rb
ish_models-0.0.33.215 lib/ish/premium_item.rb
ish_models-0.0.33.214 lib/ish/premium_item.rb
ish_models-0.0.33.213 lib/ish/premium_item.rb
ish_models-0.0.33.212 lib/ish/premium_item.rb
ish_models-0.0.33.211 lib/ish/premium_item.rb
ish_models-0.0.33.210 lib/ish/premium_item.rb
ish_models-0.0.33.209 lib/ish/premium_item.rb
ish_models-0.0.33.208 lib/ish/premium_item.rb
ish_models-0.0.33.207 lib/ish/premium_item.rb
ish_models-0.0.33.206 lib/ish/premium_item.rb
ish_models-0.0.33.205 lib/ish/premium_item.rb
ish_models-0.0.33.204 lib/ish/premium_item.rb
ish_models-0.0.33.203 lib/ish/premium_item.rb
ish_models-0.0.33.202 lib/ish/premium_item.rb
ish_models-0.0.33.201 lib/ish/premium_item.rb
ish_models-0.0.33.200 lib/ish/premium_item.rb