Class: ActiveRecord::FixtureSet::RenderContext

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/fixture_set/render_context.rb

Overview

NOTE: This class has to be defined in compact style in order for rendering context subclassing to work correctly.

Class Method Summary collapse

Class Method Details

.create_subclassObject

:nodoc:



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/active_record/fixture_set/render_context.rb', line 8

def self.create_subclass
  Class.new(ActiveRecord::FixtureSet.context_class) do
    def get_binding
      binding()
    end

    def binary(path)
      %(!!binary "#{Base64.strict_encode64(File.binread(path))}")
    end
  end
end