Module: ActiveRecord::Concerns::Base

Defined in:
app/lib/active_record/concerns/base.rb

Instance Method Summary collapse

Instance Method Details

#adapterObject

Adapter



10
11
12
# File 'app/lib/active_record/concerns/base.rb', line 10

def adapter
  ENV["DATABASE_ADAPTER"]
end

#downObject

Down



15
16
17
# File 'app/lib/active_record/concerns/base.rb', line 15

def down
 drop_table table, if_exists: true
end

#tableObject

Table



25
26
27
# File 'app/lib/active_record/concerns/base.rb', line 25

def table
  self.class.name.gsub!("Create", "").underscore
end

#uuid(key = :id) ⇒ Object

UUID



20
21
22
# File 'app/lib/active_record/concerns/base.rb', line 20

def uuid(key=:id)
  adapter == "sqlite3" ? {} : { key => :uuid }
end