Sha256: 0ddefa1d80de0591dad9cc5bb5c14c83b206ab6069b4ef92c3526a99b6bb1ddc

Contents?: true

Size: 281 Bytes

Versions: 6

Compression:

Stored size: 281 Bytes

Contents

module ActiveMocker
  module Mock

    class HasOne < SingleRelation

      attr_reader :item

      def initialize(item, child_self:, foreign_key:)
        item.send(:write_attribute, foreign_key, item.try(:id)) if !item.try(:id).nil?
        super
      end

    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_mocker-2.0.0.beta1 lib/active_mocker/mock/has_one.rb
active_mocker-1.8.4 lib/active_mocker/mock/has_one.rb
active_mocker-1.8.3 lib/active_mocker/mock/has_one.rb
active_mocker-1.8.2 lib/active_mocker/mock/has_one.rb
active_mocker-1.8.1 lib/active_mocker/mock/has_one.rb
active_mocker-1.8 lib/active_mocker/mock/has_one.rb