Skip to content

Commit

Permalink
Merge pull request #31995 from eugeneius/active_storage_require_depen…
Browse files Browse the repository at this point in the history
…dency

Use require_dependency inside Active Storage
  • Loading branch information
rafaelfranca committed Feb 15, 2018
2 parents 957ca2e + 1e55ee5 commit fbc7d63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions activestorage/app/models/active_storage/blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions activestorage/app/models/active_storage/filename.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbc7d63

Please sign in to comment.