Class: ApiConsumer

Inherits:
ApplicationRecord show all
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)

Instance Method Summary collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Instance Method Details

#generate_api_keyObject



29
30
31
# File 'app/models/api_consumer.rb', line 29

def generate_api_key
  self.update_attribute(:api_key, Encryption.encrypt_string("#{self.id}"))
end