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
404 405 406 407 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 404 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
410 411 412 413 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 410 def lazy raise Error, "lazy loading disabled" if model.cti_subclass_load == :eager_only clone(:eager_load => false) end |
#single_record ⇒ Object
395 396 397 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 395 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
416 417 418 419 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 416 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
399 400 401 |
# File 'lib/sequel/plugins/hybrid_table_inheritance.rb', line 399 def with_sql_first(sql) post_load_record(super) end |