diff options
author | yalab <rudeboyjet@gmail.com> | 2017-08-04 18:58:16 +0900 |
---|---|---|
committer | yalab <rudeboyjet@gmail.com> | 2017-08-12 18:35:32 +0900 |
commit | daad0736f30b7c665aa733512eac8d32873841db (patch) | |
tree | b91cc40274e9dded26fe237a94357e94fd7bcaac /activerecord/lib | |
parent | 050bbb1f3329bd4fe7740e7feb572e95c246d49e (diff) | |
download | rails-daad0736f30b7c665aa733512eac8d32873841db.tar.gz rails-daad0736f30b7c665aa733512eac8d32873841db.tar.bz2 rails-daad0736f30b7c665aa733512eac8d32873841db.zip |
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 |