class RSpec::ActiveModel::Mocks::Mocks::Association

Starting with Rails 4.1, ActiveRecord associations are inversible by default. This class represents an association from the mocked model's perspective.

@private

Attributes

inversed[RW]
target[RW]

Public Class Methods

new(association_name) click to toggle source
# File lib/rspec/active_model/mocks/mocks.rb, line 38
def initialize(association_name)
  @association_name = association_name
end

Public Instance Methods

inversed_from(record) click to toggle source
# File lib/rspec/active_model/mocks/mocks.rb, line 42
def inversed_from(record)
  self.target = record
  @inversed = !!record
end