Class: Munificent::Game
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Munificent::Game
- Defined in:
- app/models/munificent/game.rb
Instance Method Summary collapse
Methods inherited from ApplicationRecord
Instance Method Details
#bulk_key_entry ⇒ Object
10 |
# File 'app/models/munificent/game.rb', line 10 def bulk_key_entry; end |
#bulk_key_entry=(codes) ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/models/munificent/game.rb', line 12 def bulk_key_entry=(codes) requested_codes = codes.split("\n") existing_codes = keys.map(&:code) new_codes = (requested_codes - existing_codes).map { |code| Key.new(code:) } self.keys += new_codes end |