Module: Sequel::Plugins::HybridTableInheritance::DatasetMethods
- Defined in:
- lib/sequel/plugins/hybrid_table_inheritance.rb
Instance Method Summary collapse
-
#eager ⇒ Object
Set dataset to use eager loading.
-
#lazy ⇒ Object
Set dataset to use lazy loading.
- #single_record ⇒ Object
-
#uses_eager_load? ⇒ Boolean
Return true if eager loading will be used, false/nil for lazy loading.
- #with_sql_first(sql) ⇒ Object
Instance Method Details
#eager ⇒ Object
Set dataset to use eager loading
413 414 415 416 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 413 def eager raise Error, "eager loading disabled" if model.cti_subclass_load == :lazy_only clone(:eager_load => true) end |
#lazy ⇒ Object
Set dataset to use lazy loading
419 420 421 422 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 419 def lazy raise Error, "lazy loading disabled" if model.cti_subclass_load == :eager_only clone(:eager_load => false) end |
#single_record ⇒ Object
404 405 406 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 404 def single_record post_load_record(super) end |
#uses_eager_load? ⇒ Boolean
Return true if eager loading will be used, false/nil for lazy loading
425 426 427 428 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 425 def uses_eager_load? return opts[:eager_load] unless opts[:eager_load].nil? [:eager, :eager_only].include?(model.cti_subclass_load) end |
#with_sql_first(sql) ⇒ Object
408 409 410 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 408 def with_sql_first(sql) post_load_record(super) end |