Sha256: 3c0dea238be5de4d9ee7d7d4ea11a144737b63bbd57fb77a3c37b96e9b0389c1

Contents?: true

Size: 243 Bytes

Versions: 7

Compression:

Stored size: 243 Bytes

Contents

module ActiveMocker
  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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_mocker-2.1.3 lib/active_mocker/mock/has_one.rb
active_mocker-2.1.2 lib/active_mocker/mock/has_one.rb
active_mocker-2.1.1 lib/active_mocker/mock/has_one.rb
active_mocker-2.1.0 lib/active_mocker/mock/has_one.rb
active_mocker-2.0.0 lib/active_mocker/mock/has_one.rb
active_mocker-2.0.0.rc1 lib/active_mocker/mock/has_one.rb
active_mocker-2.0.0.pre1 lib/active_mocker/mock/has_one.rb