Module: ActiveOutbox::AdapterHelper
- Included in:
- Generators::ModelGenerator
- Defined in:
- lib/active_outbox/adapter_helper.rb
Class Method Summary collapse
- .bigint_type ⇒ Object
- .json_type ⇒ Object
- .mysql? ⇒ Boolean
- .postgres? ⇒ Boolean
- .uuid_type ⇒ Object
Class Method Details
.bigint_type ⇒ Object
19 20 21 22 23 |
# File 'lib/active_outbox/adapter_helper.rb', line 19 def self.bigint_type return 'bigint' if postgres? || mysql? 'integer' end |
.json_type ⇒ Object
12 13 14 15 16 17 |
# File 'lib/active_outbox/adapter_helper.rb', line 12 def self.json_type return 'jsonb' if postgres? return 'json' if mysql? 'string' end |
.mysql? ⇒ Boolean
29 30 31 |
# File 'lib/active_outbox/adapter_helper.rb', line 29 def self.mysql? ActiveRecord::Base.connection.adapter_name.downcase == 'mysql2' end |
.postgres? ⇒ Boolean
25 26 27 |
# File 'lib/active_outbox/adapter_helper.rb', line 25 def self.postgres? ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql' end |
.uuid_type ⇒ Object
5 6 7 8 9 10 |
# File 'lib/active_outbox/adapter_helper.rb', line 5 def self.uuid_type return 'uuid' if postgres? return 'string' if mysql? 'string' end |