Class: Vorpal::LookupByFk
- Inherits:
-
Object
- Object
- Vorpal::LookupByFk
- Defined in:
- lib/vorpal/db_loader.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config, fk_info, fk_values) ⇒ LookupByFk
constructor
A new instance of LookupByFk.
- #load_all(db_driver) ⇒ Object
Constructor Details
#initialize(config, fk_info, fk_values) ⇒ LookupByFk
Returns a new instance of LookupByFk.
135 136 137 138 139 |
# File 'lib/vorpal/db_loader.rb', line 135 def initialize(config, fk_info, fk_values) @config = config @fk_info = fk_info @fk_values = fk_values end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
134 135 136 |
# File 'lib/vorpal/db_loader.rb', line 134 def config @config end |
Instance Method Details
#load_all(db_driver) ⇒ Object
141 142 143 144 |
# File 'lib/vorpal/db_loader.rb', line 141 def load_all(db_driver) return [] if @fk_values.empty? db_driver.load_by_foreign_key(@config.db_class, @fk_values, @fk_info) end |