diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-02-14 19:32:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-14 19:32:10 -0500 |
commit | fbc7d63ab46a50bb716dd96059fc4e898b0b865f (patch) | |
tree | d4a0c3cd1bad18c027085593ade82a9b22a82490 /activestorage | |
parent | 957ca2ed4cd355198374cff19eff0e9a15af4fef (diff) | |
parent | 1e55ee5a283df448c6cf4c4d3bb9c98e49927520 (diff) | |
download | rails-fbc7d63ab46a50bb716dd96059fc4e898b0b865f.tar.gz rails-fbc7d63ab46a50bb716dd96059fc4e898b0b865f.tar.bz2 rails-fbc7d63ab46a50bb716dd96059fc4e898b0b865f.zip |
Merge pull request #31995 from eugeneius/active_storage_require_dependency
Use require_dependency inside Active Storage
Diffstat (limited to 'activestorage')
-rw-r--r-- | activestorage/app/models/active_storage/blob.rb | 10 | ||||
-rw-r--r-- | activestorage/app/models/active_storage/filename.rb | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/activestorage/app/models/active_storage/blob.rb b/activestorage/app/models/active_storage/blob.rb index 3bcd7599d0..31fbc66965 100644 --- a/activestorage/app/models/active_storage/blob.rb +++ b/activestorage/app/models/active_storage/blob.rb @@ -14,9 +14,13 @@ # update a blob's metadata on a subsequent pass, but you should not update the key or change the uploaded file. # If you need to create a derivative or otherwise change the blob, simply create a new blob and purge the old one. class ActiveStorage::Blob < ActiveRecord::Base - include ActiveStorage::Blob::Analyzable - include ActiveStorage::Blob::Identifiable - include ActiveStorage::Blob::Representable + require_dependency "active_storage/blob/analyzable" + require_dependency "active_storage/blob/identifiable" + require_dependency "active_storage/blob/representable" + + include Analyzable + include Identifiable + include Representable self.table_name = "active_storage_blobs" diff --git a/activestorage/app/models/active_storage/filename.rb b/activestorage/app/models/active_storage/filename.rb index 2b8880716e..bebb5e61b3 100644 --- a/activestorage/app/models/active_storage/filename.rb +++ b/activestorage/app/models/active_storage/filename.rb @@ -3,6 +3,8 @@ # Encapsulates a string representing a filename to provide convenient access to parts of it and sanitization. # A Filename instance is returned by ActiveStorage::Blob#filename, and is comparable so it can be used for sorting. class ActiveStorage::Filename + require_dependency "active_storage/filename/parameters" + include Comparable class << self |