Class: ActiveRecord::FixtureSet::RenderContext

Inherits:
Object
  • Object
show all
Includes:
BinaryFixtures::FixtureHelpers
Defined in:
lib/binary_fixtures/rails_13022.rb,
lib/binary_fixtures/patch_rails.rb

Overview

The context used by the ERB fixture renderer.

Make helper functions available in your fixtures by defining them in a module and including it in ActiveRecord::FixtureSet::RenderContext.

A new subclass of this class is created each time the ERB renderer is called so that methods defined in ERB templates do not leak into other templates’ context.

Class Method Summary collapse

Methods included from BinaryFixtures::FixtureHelpers

#binary_file

Class Method Details

.createObject

An instance of a new RenderContext subclass.



16
17
18
19
20
21
22
23
24
# File 'lib/binary_fixtures/rails_13022.rb', line 16

def self.create
  klass = ::Class.new(ActiveRecord::FixtureSet::RenderContext) do
    def get_binding
      binding()
    end
  end

  klass.new
end