class ActiveRecord::Fixture

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/active_record/fixtures.rbs

class ActiveRecord::Fixture
  def initialize: (Hash fixture, Class model_class) -> void
end

:nodoc:

def [](key)

def [](key)
  fixture[key]
end

def class_name

def class_name
  model_class.name if model_class
end

def each(&block)

def each(&block)
  fixture.each(&block)
end

def find

def find
  raise FixtureClassNotFound, "No class attached to find." unless model_class
  object = model_class.unscoped do
    model_class.find(fixture[model_class.primary_key])
  end
  # Fixtures can't be eagerly loaded
  object.instance_variable_set(:@strict_loading, false)
  object
end

def initialize(fixture, model_class)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: ((follower | String | followed | String | name | String | email | String | password_digest | String | activated | TrueClass | activated_at | String) fixture, Class model_class) -> void

This signature was generated using 2 samples from 1 application.

def initialize(fixture, model_class)
  @fixture     = fixture
  @model_class = model_class
end