Class: Munificent::DonatorBundleTier

Inherits:
ApplicationRecord show all
Defined in:
app/models/munificent/donator_bundle_tier.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

#to_s

Instance Method Details

#fulfilled?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'app/models/munificent/donator_bundle_tier.rb', line 44

def fulfilled?
  bundle_tier.bundle_tier_games.count == assigned_games.count
end

#locked?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'app/models/munificent/donator_bundle_tier.rb', line 40

def locked?
  !unlocked?
end

#unlock!Object



36
37
38
# File 'app/models/munificent/donator_bundle_tier.rb', line 36

def unlock!
  update!(unlocked: true) if locked?
end