You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/app/models/export_location.rb

23 lines
722 B

# == Schema Information
#
# Table name: export_locations
#
# id :bigint not null, primary key
# api_base_url :string not null
# authorization_token :string
# default_location :boolean default(FALSE), not null
# extra_params :jsonb not null
# name :string not null
# templates_endpoint :string
# created_at :datetime not null
# updated_at :datetime not null
#
class ExportLocation < ApplicationRecord
validates :name, presence: true
validates :api_base_url, presence: true
def self.default_location
where(default_location: true).first || ExportLocation.first
end
end