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.179 lib/ish/premium_item.rb
ish_models-0.0.33.178 lib/ish/premium_item.rb
ish_models-0.0.33.177 lib/ish/premium_item.rb
ish_models-0.0.33.176 lib/ish/premium_item.rb
ish_models-0.0.33.175 lib/ish/premium_item.rb
ish_models-0.0.33.174 lib/ish/premium_item.rb
ish_models-0.0.33.173 lib/ish/premium_item.rb
ish_models-0.0.33.172 lib/ish/premium_item.rb
ish_models-0.0.33.170 lib/ish/premium_item.rb
ish_models-0.0.33.169 lib/ish/premium_item.rb
ish_models-0.0.33.168 lib/ish/premium_item.rb
ish_models-0.0.33.167 lib/ish/premium_item.rb
ish_models-0.0.33.166 lib/ish/premium_item.rb
ish_models-0.0.33.164 lib/ish/premium_item.rb
ish_models-0.0.33.163 lib/ish/premium_item.rb
ish_models-0.0.33.162 lib/ish/premium_item.rb
ish_models-0.0.33.161 lib/ish/premium_item.rb
ish_models-0.0.33.160 lib/ish/premium_item.rb
ish_models-0.0.33.159 lib/ish/premium_item.rb
ish_models-0.0.33.158 lib/ish/premium_item.rb