Sha256: f4b541f1dd9e18cd27ac43f8571d4ce8e3626f34cec4a6954418516e2cfebfe5

Contents?: true

Size: 220 Bytes

Versions: 6

Compression:

Stored size: 220 Bytes

Contents

require 'active_record'

class Player < ActiveRecord::Base

  belongs_to :user

  validates_presence_of :name, :gold, :user

  def to_hash
    {
      name: name,
      gold: gold,
      userId: user_id,
    }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubypitaya-2.6.4 ./lib/rubypitaya/app-template/app/models/player.rb
rubypitaya-2.6.3 ./lib/rubypitaya/app-template/app/models/player.rb
rubypitaya-2.6.2 ./lib/rubypitaya/app-template/app/models/player.rb
rubypitaya-2.6.1 ./lib/rubypitaya/app-template/app/models/player.rb
rubypitaya-2.6.0 ./lib/rubypitaya/app-template/app/models/player.rb
rubypitaya-2.5.1 ./lib/rubypitaya/app-template/app/models/player.rb