Sha256: c64df35b124c36d1e03220fcdfe742ea4a09abf96fe6ba95f15b67f106e57a3b

Contents?: true

Size: 444 Bytes

Versions: 1

Compression:

Stored size: 444 Bytes

Contents

module RestPack::Core::Service::Models
  class Host < Base
    restpack_table_name :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.5 lib/restpack_core_service/models/host.rb