Class: MagicModels::Schema::Base
- Inherits:
-
Object
- Object
- MagicModels::Schema::Base
- Defined in:
- lib/magic_models/schema.rb
Instance Attribute Summary collapse
-
#base_class ⇒ Object
Returns the value of attribute base_class.
-
#connection ⇒ Object
Returns the value of attribute connection.
Instance Method Summary collapse
- #data_sources ⇒ Object
- #exclude(*tables) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #models ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 |
# File 'lib/magic_models/schema.rb', line 10 def initialize @base_class = 'ActiveRecord::Base' @connection = ActiveRecord::Base.connection @exclude = ['schema_migrations', 'ar_internal_metadata'] end |
Instance Attribute Details
#base_class ⇒ Object
Returns the value of attribute base_class.
7 8 9 |
# File 'lib/magic_models/schema.rb', line 7 def base_class @base_class end |
#connection ⇒ Object
Returns the value of attribute connection.
7 8 9 |
# File 'lib/magic_models/schema.rb', line 7 def connection @connection end |
Instance Method Details
#data_sources ⇒ Object
20 21 22 |
# File 'lib/magic_models/schema.rb', line 20 def data_sources connection.data_sources - @exclude end |
#exclude(*tables) ⇒ Object
16 17 18 |
# File 'lib/magic_models/schema.rb', line 16 def exclude(*tables) @exclude += tables.flatten end |