Class: OTR::ActiveRecord::ShimBase
- Inherits:
-
Object
- Object
- OTR::ActiveRecord::ShimBase
- Defined in:
- lib/otr-activerecord/shim/base.rb
Overview
Base compatibility layer for ActiveRecord
Direct Known Subclasses
Instance Method Summary collapse
-
#force_db_test_env? ⇒ Boolean
Force RACK_ENV/RAILS_ENV to be ‘test’ when running any db:test:* tasks.
-
#initialize ⇒ ShimBase
constructor
A new instance of ShimBase.
-
#migration_base_class_name ⇒ Object
Basename of migration classes.
-
#migrations_path ⇒ Object
The dir in which to put new migrations.
-
#migrations_paths ⇒ Object
All db migration dir paths.
Constructor Details
#initialize ⇒ ShimBase
Returns a new instance of ShimBase.
5 6 7 |
# File 'lib/otr-activerecord/shim/base.rb', line 5 def initialize ::ActiveRecord.default_timezone = :utc end |
Instance Method Details
#force_db_test_env? ⇒ Boolean
Force RACK_ENV/RAILS_ENV to be ‘test’ when running any db:test:* tasks
27 28 29 |
# File 'lib/otr-activerecord/shim/base.rb', line 27 def force_db_test_env? false end |
#migration_base_class_name ⇒ Object
Basename of migration classes
20 21 22 23 24 |
# File 'lib/otr-activerecord/shim/base.rb', line 20 def migration_base_class_name major_v = ::ActiveRecord::VERSION::MAJOR minor_v = ::ActiveRecord::VERSION::MINOR "ActiveRecord::Migration[#{major_v}.#{minor_v}]" end |
#migrations_path ⇒ Object
The dir in which to put new migrations
15 16 17 |
# File 'lib/otr-activerecord/shim/base.rb', line 15 def migrations_path OTR::ActiveRecord.migrations_paths[0] end |
#migrations_paths ⇒ Object
All db migration dir paths
10 11 12 |
# File 'lib/otr-activerecord/shim/base.rb', line 10 def migrations_paths OTR::ActiveRecord.migrations_paths end |