Class: ApiConsumer
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ApiConsumer
- Defined in:
- app/models/api_consumer.rb
Overview
== Schema Information
Table name: api_consumers
Database name: primary
id :integer not null, primary key
api_key :string
api_version :string
application_type :string
name :string
created_at :datetime
updated_at :datetime
Indexes
index_api_consumers_on_api_key (api_key)
index_api_consumers_on_api_version (api_version)
index_api_consumers_on_application_type (application_type)
index_api_consumers_on_name (name)
Constant Summary
Constants included from Schedulable
Schedulable::SIMPLE_FORM_OPTIONS
Instance Attribute Summary collapse
-
#api_version ⇒ Object
readonly
has_many :api_access_statistics.
-
#application_type ⇒ Object
readonly
has_many :api_access_statistics.
-
#name ⇒ Object
readonly
has_many :api_access_statistics.
Instance Method Summary collapse
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Schedulable
Methods included from Models::AfterCommittable
Methods included from Models::EventPublishable
Instance Attribute Details
#api_version ⇒ Object (readonly)
has_many :api_access_statistics
Validations:
25 |
# File 'app/models/api_consumer.rb', line 25 validates :name, :api_version, :application_type, presence: true |
#application_type ⇒ Object (readonly)
has_many :api_access_statistics
Validations:
25 |
# File 'app/models/api_consumer.rb', line 25 validates :name, :api_version, :application_type, presence: true |
#name ⇒ Object (readonly)
has_many :api_access_statistics
Validations:
25 |
# File 'app/models/api_consumer.rb', line 25 validates :name, :api_version, :application_type, presence: true |
Instance Method Details
#generate_api_key ⇒ Object
29 30 31 |
# File 'app/models/api_consumer.rb', line 29 def generate_api_key update_attribute(:api_key, Encryption.encrypt_string(id.to_s)) end |