Sha256: 7004b2e4ab33ba3b7df2cf88bcee44d909c7ca0c9021c784bea2700f206ddf55

Contents?: true

Size: 374 Bytes

Versions: 1

Compression:

Stored size: 374 Bytes

Contents

module RestPack::Core::Service::Models
  class Application < ActiveRecord::Base
    self.table_name = :restpack_applications
    attr_accessible :name, :account_id

    validates_presence_of :name, :account_id
    validates :name, :length => { :maximum => 256 }

    has_many :hosts

    before_save -> {
      self.api_token ||= SecureRandom.hex(50)[0..31]
    }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
restpack_core_service-0.0.6 lib/restpack_core_service/models/application.rb