aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/fixture_set/render_context.rb
blob: c90b5343dc2bf9e2f55eba4f773cb844344b5790 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                
# frozen_string_literal: true

# NOTE: This class has to be defined in compact style in
# order for rendering context subclassing to work correctly.
class ActiveRecord::FixtureSet::RenderContext # :nodoc:
  def self.create_subclass
    Class.new(ActiveRecord::FixtureSet.context_class) do
      def get_binding
        binding()
      end

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