Sha256: 0597c6c91e399e19b2d58645bda2ede911f2d9c3ba46b4a98e806537732b9583

Contents?: true

Size: 539 Bytes

Versions: 1

Compression:

Stored size: 539 Bytes

Contents

module RestPack::Core::Service::Models
  class Domain < ActiveRecord::Base
    self.table_name = :restpack_domains
    attr_accessible :identifier, :application_id, :is_verified, :session_secret, :oauth_providers

    validates_presence_of :identifier, :application_id
    validates :identifier, :length => { :maximum => 512 }

    belongs_to :application, class_name: 'RestPack::Core::Service::Models::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.8 lib/restpack_core_service/models/domain.rb