Sha256: db2b88237e3e1ce8dcc7c29f4a81dc62cd86f6802c03cf96181bcad889c090e9

Contents?: true

Size: 645 Bytes

Versions: 13

Compression:

Stored size: 645 Bytes

Contents

module NinjaModel
  module Associations
    class HasManyAssociation < CollectionAssociation

      #def insert_record(record, validate = true, raise = false)
      #  set_owner_attributes(record)

      #  if raise
      #    record.save!(:validate => validate)
      #  else
      #    record.save(:validate => validate)
      #  end
      #end

      #def association_scope
      #  scope = super
      #  puts "primary_key: #{reflection.primary_key}"
      #  puts "foreign_key: #{reflection.foreign_key}"
      #  scope = scope.where(reflection.foreign_key => owner.send(reflection.primary_key))
      #  scope
      #end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ninja-model-1.0.5 lib/ninja_model/associations/has_many_association.rb
ninja-model-1.0.4 lib/ninja_model/associations/has_many_association.rb
ninja-model-1.0.3 lib/ninja_model/associations/has_many_association.rb
ninja-model-1.0.2 lib/ninja_model/associations/has_many_association.rb
ninja-model-1.0.1 lib/ninja_model/associations/has_many_association.rb
ninja-model-1.0.0 lib/ninja_model/associations/has_many_association.rb
ninja-model-0.9.6 lib/ninja_model/associations/has_many_association.rb
ninja-model-0.9.5 lib/ninja_model/associations/has_many_association.rb
ninja-model-0.9.4 lib/ninja_model/associations/has_many_association.rb
ninja-model-0.9.3 lib/ninja_model/associations/has_many_association.rb
ninja-model-0.9.2 lib/ninja_model/associations/has_many_association.rb
ninja-model-0.9.1 lib/ninja_model/associations/has_many_association.rb
ninja-model-0.9.0 lib/ninja_model/associations/has_many_association.rb