Module: ActiveRecord::Concerns::Base
- Defined in:
- app/lib/active_record/concerns/base.rb
Instance Method Summary collapse
-
#adapter ⇒ Object
Adapter.
-
#down ⇒ Object
Down.
-
#options(key = :id) ⇒ Object
UUID.
-
#table ⇒ Object
Table.
Instance Method Details
#adapter ⇒ Object
Adapter
10 11 12 |
# File 'app/lib/active_record/concerns/base.rb', line 10 def adapter ENV["DATABASE_ADAPTER"] end |
#down ⇒ Object
Down
18 19 20 |
# File 'app/lib/active_record/concerns/base.rb', line 18 def down drop_table table, if_exists: true end |
#options(key = :id) ⇒ Object
UUID
23 24 25 26 27 28 29 30 |
# File 'app/lib/active_record/concerns/base.rb', line 23 def (key=:id) case adapter when "mysql2" { options: 'DEFAULT CHARSET=utf8' } else {} end end |
#table ⇒ Object
Table
33 34 35 |
# File 'app/lib/active_record/concerns/base.rb', line 33 def table self.class.name.gsub!("Create", "").underscore end |