Class: Clerk::ApplicationRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Clerk::ApplicationRecord
show all
- Defined in:
- lib/clerk/application_record.rb
Class Method Summary
collapse
Class Method Details
.clerk_persistence_api ⇒ Object
13
14
15
16
17
18
|
# File 'lib/clerk/application_record.rb', line 13
def self.clerk_persistence_api
@@clerk_persistence_api ||= ClerkActiveRecord::Api::Connection.new(
(ENV["CLERK_API_PATH"] || "https://api.clerk.dev"),
ENV["CLERK_KEY"]
)
end
|
.clerk_persistence_path ⇒ Object
9
10
11
|
# File 'lib/clerk/application_record.rb', line 9
def self.clerk_persistence_path
"/v1/#{table_name[0...-3]}"
end
|
.clerk_table_name(table_name) ⇒ Object
5
6
7
|
# File 'lib/clerk/application_record.rb', line 5
def self.clerk_table_name(table_name)
"#{table_name}_01"
end
|
.transaction(options = {}, &block) ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/clerk/application_record.rb', line 20
def self.transaction(options = {}, &block)
yield
rescue ActiveRecord::Rollback
end
|