Method: ConfigScripts::Seeds::SeedType#items
- Defined in:
- lib/config_scripts/seeds/seed_type.rb
#items ⇒ Relation
This method gets the items that we should write to our seed file.
It will start with the scoped list for the model class, and then apply all the scopes in our #scopes list.
330 331 332 333 334 335 |
# File 'lib/config_scripts/seeds/seed_type.rb', line 330 def items return @dynamic_fetcher.call if @dynamic_fetcher records = self.all self.scopes.each { |method, args| records = records.send(method, *args) } records end |