Sha256: d218c8ca3e656d1836c239b33480edf7d8db06a81ca6f9adbe56209c28e53088

Contents?: true

Size: 431 Bytes

Versions: 1

Compression:

Stored size: 431 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 :domains, class_name: 'RestPack::Core::Service::Models::Domain'

    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.8 lib/restpack_core_service/models/application.rb