aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app/models/active_storage/blob.rb
Commit message (Collapse)AuthorAgeFilesLines
* Permit configuring the default service URL expiryGeorge Claghorn2018-06-211-2/+2
|
* Include blob ID in tempfile name for debugging convenienceGeorge Claghorn2018-05-301-0/+10
|
* Verify integrity after chunked downloadGeorge Claghorn2018-05-281-0/+2
|
* Permit opening a blob in a custom tempdirGeorge Claghorn2018-05-171-2/+2
|
* Add ActiveStorage::Blob#openGeorge Claghorn2018-05-161-0/+7
| | | | [David Robertson & George Claghorn]
* Add option to ActiveStorage::Blob to set extract_content_type_from_ioRyan Davidson2018-05-081-7/+10
| | | | | | | This adds a boolean argument called identify to ActiveStorage::Blob methods #create_after_upload, #build_after_upload and #upload. It allows a user to bypass the automatic content_type inference from the io.
* Use lazy load hook to configure ActiveStorage::BlobEugene Kenny2018-02-251-0/+2
| | | | | | | | | `to_prepare` callbacks are run during initialization; using one here meant that `ActiveStorage::Blob` would be loaded when the app boots, which would in turn load `ActiveRecord::Base`. By using a lazy load hook to configure `ActiveStorage::Blob` instead, we can avoid loading `ActiveRecord::Base` unnecessarily.
* Use require_dependency inside Active StorageEugene Kenny2018-02-141-3/+7
| | | | | | | | | | | | | | | Active Storage is an engine which means its models, jobs and controllers are autoloaded by Rails rather than Ruby. Unfortunately this means it's subject to the same gotchas as applications, including this one: http://guides.rubyonrails.org/v5.1.4/autoloading_and_reloading_constants.html#when-constants-aren-t-missed-qualified-references On Ruby < 2.5, constants nested under classes can't be autoloaded by Rails if a top level constant already exists with the same name. To avoid clashing with constants defined in users' applications or gems, we can use `require_dependency` to ensure that the nested constants are loaded before they're used.
* Add ActiveStorage::Blob.unattached scopefatkodima2018-02-121-0/+2
|
* Use full class names when including concerns to avoid collisionsWojtek Wrona2018-02-121-1/+3
|
* Fix `blob.service_url` for supports string or nil `:filename` option.Jason Lee2018-02-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | - Make sure `blob.service_url` present a `ActiveStorage::Filename` type to `serivce.url`. - Add `ActiveStorage::Filename.wrap` method. before: ```rb blob.service_url(filename: ActiveStorage::Filename.new("new.txt")) blob.service_url(filename: "new.txt") => NoMethodError: undefined method `parameters' for "new.txt":String params = {} blob.service_url(filename: params[:filename]) => NoMethodError: undefined method `parameters' for nil:NilClass ``` after: ```rb blob.service_url(filename: "new.txt") blob.service_url(filename: nil) ```
* Merge pull request #31854 from huacnlee/allow-more-options-for-service-urlGeorge Claghorn2018-02-011-2/+3
|\ | | | | Allow ActiveStorage::Blob#service_url to pass addition options to service.url
| * Allow `ActiveStorage::Blob#service_url` to pass addition options to ↵Jason Lee2018-02-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `service.url`. Because there have some service needs more parameters for file URL: https://www.alibabacloud.com/help/doc-detail/44687.htm ```rb class AliyunService < Service def url(key, options = {}) image_process = options[:oss_process] || "image/resize,w_800" "http://image-demo.oss-cn-hangzhou.aliyuncs.com/example.jpg?x-oss-process=#{image_process}" end end ``` Use case: ```erb <%= image_tag @user.avatar.service_url(oss_process: "image/resize,m_fill,h_100,w_100" %> ```
* | Use the full class name for the JSON coder, as there may be anotherRenaud Chaput2018-02-011-1/+1
|/ | | | | | `JSON` constant defined. For example when using the `representable` gem: https://github.com/trailblazer/representable/issues/224
* Extract content types from blob dataGeorge Claghorn2018-01-151-4/+10
|
* Extract Analyzable and Representable concernsGeorge Claghorn2018-01-101-147/+2
|
* Allow overriding filename in `Blob#service_url`Rosa Gutierrez2018-01-081-1/+1
| | | | | | | This is useful when we have several representations for the same underlying file, each one with a different name, and we need to provide a custom download URL based on that name and not that of the underlying file.
* Force content disposition to attachment for specific content typesRosa Gutierrez2018-01-051-2/+7
| | | | | | | | | | | | | | In this way we avoid HTML, XML, SVG and other files that can be rendered by the browser to be served inline by default. Depending on the origin from where these files are served, this might lead to XSS vulnerabilities, and in the best case, to more realistic phishing attacks and open redirects. We force it rather than falling back to it when other disposition is not provided. Otherwise it would be possible for someone to force inline just by passing `disposition=inline` in the URL. The list of content types to be served as attachments is configurable.
* Update ActiveStorage::Blob#transformation docs [ci skip]George Claghorn2017-12-161-3/+3
|
* Restrict variants to variable image blobsGeorge Claghorn2017-12-151-4/+18
|
* Purge variants with their blobsGeorge Claghorn2017-12-021-1/+2
|
* Preserve existing metadata when analyzing a blobGeorge Claghorn2017-11-131-1/+1
| | | | Closes #31138.
* Extract metadata from images and videosGeorge Claghorn2017-10-221-1/+56
|
* Accept variation keys in #preview and #variantGeorge Claghorn2017-10-121-2/+2
|
* Introduce ActiveStorage::Blob#representationGeorge Claghorn2017-10-121-0/+26
|
* Associate blobs with their attachmentsGeorge Claghorn2017-10-031-0/+2
|
* Preview PDFs and videosGeorge Claghorn2017-09-281-8/+39
|
* Update Active Storage docs [ci skip]Yoshiyuki Hirano2017-08-301-2/+2
|
* Encode Content-Disposition filenames according to RFC 2231George Claghorn2017-08-211-1/+1
| | | | Closes #30134.
* DRYGeorge Claghorn2017-08-201-1/+1
|
* restores some double newlines deleted in ae87217Xavier Noria2017-08-151-0/+3
| | | | | | These were intentional, see https://github.com/rails/rails/pull/30061#issuecomment-320068368
* minor tweaks in Active Storage after a walkthroughXavier Noria2017-08-151-17/+16
|
* Use frozen string literal in Active StorageKoichi ITO2017-08-121-0/+2
|
* Fix formatting of Active Storage docs [ci skip]Koichi ITO2017-08-111-18/+18
| | | | Follow up of #30188.
* Use `content_type.start_with?("...")` than `content_type =~ /^.../`Ryuta Kamizono2017-08-051-4/+4
| | | | | `start_with?` is a little faster than regexp for prefix matching by a fixed string.
* Do not eager load ActiveRecord::BaseRafael Mendonça França2017-08-031-6/+0
| | | | Everything inside the app directory of a engine is autoload/eager loaded automatically so we don't need to require them.
* There is no reason to single line methods hereRafael Mendonça França2017-08-031-4/+12
| | | | | I know those methods are unlikely to change but having one line method is hard to read and also hard to modify.
* Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'Rafael Mendonça França2017-07-311-0/+193
git-subtree-dir: activestorage git-subtree-mainline: 0d58e7e478e79c2d6b2a39a4444d2a17a903b2a6 git-subtree-split: 3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58