Sha256: 07550338ee35e10020d5aa34c412c6040fb3c2d1934e0d45132f1890f295cb92

Contents?: true

Size: 465 Bytes

Versions: 1

Compression:

Stored size: 465 Bytes

Contents

module RestPack::Core::Service::Models
  class Host < ActiveRecord::Base
    self.table_name = :restpack_hosts
    attr_accessible :name, :application_id, :session_secret, :oauth_providers

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

    has_many :domains
    belongs_to :application

    before_save -> {
      self.oauth_providers ||= {}
      self.session_secret ||= SecureRandom.hex(16)
    }
  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/host.rb