diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-08-14 18:13:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 18:13:32 -0400 |
commit | cf91b96be3ff4aafd0ec29f5c34013792bddf33d (patch) | |
tree | 39b856d485ae26201e6554cdfe3d1c4056697607 /activerecord/lib | |
parent | bef68862ae14244fb93e0abb4c16d06eec535c2d (diff) | |
parent | daad0736f30b7c665aa733512eac8d32873841db (diff) | |
download | rails-cf91b96be3ff4aafd0ec29f5c34013792bddf33d.tar.gz rails-cf91b96be3ff4aafd0ec29f5c34013792bddf33d.tar.bz2 rails-cf91b96be3ff4aafd0ec29f5c34013792bddf33d.zip |
Merge pull request #30073 from yalab/fixture_binary_helper
Add `binary` helper method to fixtures.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index ef302fc0a0..4940e122f4 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -1065,6 +1065,10 @@ class ActiveRecord::FixtureSet::RenderContext # :nodoc: def get_binding binding() end + + def binary(path) + %(!!binary "#{Base64.strict_encode64(File.read(path))}") + end end end end |