Sha256: cdd4ae417061950e3e694011b07250b6dec1fbc085091def7bb69051af97172a

Contents?: true

Size: 382 Bytes

Versions: 17

Compression:

Stored size: 382 Bytes

Contents

module NinjaModel
  module Associations
    class HasOneAssociation < AssociationProxy

      def create(attrs = {}, replace_existing = true)
        new_record
      end

      private

      def find_target
        @reflection.klass.scoped.where(@reflection.primary_key_name => @owner.send(:id)).first
      end

      def new_record(replace_existing)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ninja-model-0.8.1 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.8.0 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.7.3 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.7.2 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.7.1 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.7.0 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.6.2 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.6.1 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.6.0 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.5.7 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.5.6 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.5.5 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.5.4 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.5.3 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.5.2 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.5.1 lib/ninja_model/associations/has_one_association.rb
ninja-model-0.4.2 lib/ninja_model/associations/has_one_association.rb