Method: Pakyow::Data::Sources::Relational.has_many
- Defined in:
- lib/pakyow/data/sources/relational.rb
.has_many(association_name, query: nil, source: association_name, as: singular_name, through: nil, dependent: :raise) ⇒ Object
rubocop:disable Naming/PredicateName
510 511 512 513 514 515 516 517 518 519 520 |
# File 'lib/pakyow/data/sources/relational.rb', line 510 def has_many(association_name, query: nil, source: association_name, as: singular_name, through: nil, dependent: :raise) Associations::HasMany.new( name: association_name, query: query, source: self, associated_source_name: source, as: as, dependent: dependent ).tap do |association| @associations[:has_many] << association if through setup_as_through(association, through: through) end end end |