Class: Troles::Adapters::ActiveRecord::Config
- Inherits:
-
Common::Config
- Object
- Common::Config
- Troles::Adapters::ActiveRecord::Config
- Defined in:
- lib/troles/adapters/active_record/config.rb
Instance Attribute Summary collapse
-
#models ⇒ Object
readonly
Returns the value of attribute models.
Attributes inherited from Common::Config
#generic, #log_on, #orm, #strategy, #subject_class
Attributes included from Common::Config::ClassMethods
#auto_load, #default_orm, #log_on
Instance Method Summary collapse
-
#configure_field ⇒ Object
AR sets this up ont its own using DB Table info.
- #configure_relation ⇒ Object
-
#initialize(subject_class, options = {}) ⇒ Config
constructor
A new instance of Config.
Methods inherited from Common::Config
#apply_options!, #auto_config, #auto_config?, #configure!, #default_main_field, #generic?, #log_on?, #main_field=, #singularity, sub_modules
Methods included from Common::Config::ClassMethods
#auto_config, #auto_config?, #auto_load?, #log_on?
Constructor Details
#initialize(subject_class, options = {}) ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 |
# File 'lib/troles/adapters/active_record/config.rb', line 6 def initialize subject_class, = {} super puts "models classes: #{subject_class}, #{object_model}, #{join_model}" @models = ::Schemaker::Models.new(subject_class, object_model, join_model) end |
Instance Attribute Details
#models ⇒ Object (readonly)
Returns the value of attribute models.
4 5 6 |
# File 'lib/troles/adapters/active_record/config.rb', line 4 def models @models end |
Instance Method Details
#configure_field ⇒ Object
AR sets this up ont its own using DB Table info
25 26 |
# File 'lib/troles/adapters/active_record/config.rb', line 25 def configure_field end |
#configure_relation ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/troles/adapters/active_record/config.rb', line 12 def configure_relation case strategy when :join_ref_many configure_join_model when :ref_many return configure_join_model if join_model? subject.quick_join when :embed_many raise "Embed many configuration not yet implemented for ActiveRecord" end end |