aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
Commit message (Collapse)AuthorAgeFilesLines
* Remove support to Ruby 2.2Rafael Mendonça França2018-02-161-1/+1
| | | | Rails 6 will only support Ruby >= 2.3.
* Use require_dependency inside Active StorageEugene Kenny2018-02-142-3/+9
| | | | | | | | | | | | | | | 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.
* Document MuPDF version requirementGeorge Claghorn2018-02-131-1/+1
|
* Add ActiveStorage::Blob.unattached scopefatkodima2018-02-122-0/+19
|
* Use full class names when including concerns to avoid collisionsWojtek Wrona2018-02-121-1/+3
|
* Add missing requireGeorge Claghorn2018-02-111-0/+2
|
* Merge pull request #31927 from mrreynolds/patch-2Eileen M. Uchitelle2018-02-091-0/+8
|\ | | | | Document :combine_options
| * Document :combine_optionsRobert Glaser2018-02-081-0/+8
| | | | | | | | Turns out this is still undocumented functionality.
* | Fix `blob.service_url` for supports string or nil `:filename` option.Jason Lee2018-02-083-1/+13
|/ | | | | | | | | | | | | | | | | | | | | | | | | - 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) ```
* Include source code in published activestorage npm packageRichard Macklin2018-02-063-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows activestorage users to ship smaller javascript bundles to visitors using modern browsers, as demonstrated in this repository: https://github.com/rmacklin/activestorage-es2015-build-example In that example, the bundle shrinks by 5K (24%). In addition to allowing smaller bundles for those who ship untranspiled code to modern browsers, including the source code in the published package can be useful in other ways: 1. Users can import individual modules rather than the whole library 2. As a result of (1), users can also monkey patch parts of activestorage by importing the relevant module, modifying the exported object, and then importing the rest of activestorage (which would then use the patched object). Note: In order to allow the source code to be depended on rather than the compiled code, we have to declare the external dependency on spark-md5 as a regular dependency, not a development dependency. This means that even users who depend on the compiled code will have to download this package. However, spark-md5 is a small package, so this tradeoff seems worth it.
* Merge pull request #31854 from huacnlee/allow-more-options-for-service-urlGeorge Claghorn2018-02-012-2/+23
|\ | | | | 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-012-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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
* Correct orientation detectionGeorge Claghorn2018-01-312-3/+3
|
* Swap encoded image width and height if angle is 90 or 270 degreesGeorge Claghorn2018-01-313-3/+26
|
* Start Rails 6.0 development!!!Rafael Mendonça França2018-01-303-37/+5
| | | | :tada::tada::tada:
* Add a test for ActiveStorage::Blob#image? and ActiveStorage::Blob#video?Shuhei Kitagawa2018-01-291-0/+12
|
* Eliminate ActiveStorage::Service::MirrorServiceTest#uploadShuhei Kitagawa2018-01-271-16/+16
|
* Unlink internal tempfiles after useGeorge Claghorn2018-01-262-2/+22
|
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-256-24/+24
|
* Add missing requireGeorge Claghorn2018-01-221-3/+5
|
* Cope with videos with undefined display aspect ratiosGeorge Claghorn2018-01-203-2/+15
|
* Use helper methodGeorge Claghorn2018-01-191-1/+2
|
* Preserve display aspect ratio for videos with rectangular samplesGeorge Claghorn2018-01-194-19/+62
|
* Revert "Merge pull request #31434 from olivierlacan/boot-feedback"Matthew Draper2018-01-191-4/+0
| | | | | | | | | This reverts commit edc54fd2068bc21f0d381228e55d97e32f508923, reversing changes made to a5922f132f4d163e2c7f770427087f5268c18def. As discussed, this is not an appropriate place to make assumptions about ARGV, or to write to stdout: config/boot.rb is a library and is required by other applictions, with which we have no right to interfere.
* Refactor migration to move migrations paths to connectioneileencodes2018-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails has some support for multiple databases but it can be hard to handle migrations with those. The easiest way to implement multiple databases is to contain migrations into their own folder ("db/migrate" for the primary db and "db/seconddb_migrate" for the second db). Without this you would need to write code that allowed you to switch connections in migrations. I can tell you from experience that is not a fun way to implement multiple databases. This refactoring is a pre-requisite for implementing other features related to parallel testing and improved handling for multiple databases. The refactoring here moves the class methods from the `Migrator` class into it's own new class `MigrationContext`. The goal was to move the `migrations_paths` method off of the `Migrator` class and onto the connection. This allows users to do the following in their `database.yml`: ``` development: adapter: mysql2 username: root password: development_seconddb: adapter: mysql2 username: root password: migrations_paths: "db/second_db_migrate" ``` Migrations for the `seconddb` can now be store in the `db/second_db_migrate` directory. Migrations for the primary database are stored in `db/migrate`". The refactoring here drastically reduces the internal API for migrations since we don't need to pass `migrations_paths` around to every single method. Additionally this change does not require any Rails applications to make changes unless they want to use the new public API. All of the class methods from the `Migrator` class were `nodoc`'d except for the `migrations_paths` and `migrations_path` getter/setters respectively.
* Provide a sensible default hostGeorge Claghorn2018-01-166-8/+6
|
* Extract content types from blob dataGeorge Claghorn2018-01-1516-32/+132
|
* Instrument image transformationGeorge Claghorn2018-01-101-7/+9
|
* Instrument preview image drawingGeorge Claghorn2018-01-101-3/+5
|
* Update error names in docs [ci skip]George Claghorn2018-01-101-3/+3
|
* Add missing `# frozen_string_literal: true`Ryuta Kamizono2018-01-113-0/+6
|
* Correct comment [ci skip]George Claghorn2018-01-101-1/+1
|
* Extract Analyzable and Representable concernsGeorge Claghorn2018-01-108-150/+158
|
* Change Active Storage destroy callbackskami-zh2018-01-092-2/+8
| | | | | There is concern that only blob are deleted depending on the `before_destroy` definition order which throws abort.
* Rebuild activestorage.jsJavan Makhmali2018-01-081-1/+1
| | | | To pick up 21417e02e906f6b64f013aafefdc0cb8ea8b5e74
* Work around Firefox's refusal to dispatch events on disabled elements. Fixes ↵Javan Makhmali2018-01-081-1/+10
| | | | | | #31393 Brought to you by a 12 year old Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=329509
* Fix attaching blobs to optimistically-locked recordsGeorge Claghorn2018-01-081-2/+2
| | | | | | Explicitly declare inverse associations so ActiveStorage::Attachment touches the original record instance. Closes #31542.
* Allow overriding filename in `Blob#service_url`Rosa Gutierrez2018-01-082-4/+15
| | | | | | | 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.
* Document automatic width-height swapping [ci skip]George Claghorn2018-01-071-0/+2
|
* Remove redundant sentences [ci skip]George Claghorn2018-01-072-4/+2
|
* Tweak engine for readabilityGeorge Claghorn2018-01-071-11/+13
|
* Force content disposition to attachment for specific content typesRosa Gutierrez2018-01-055-2/+36
| | | | | | | | | | | | | | 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.
* Configure previewer/analyzer command paths centrallyGeorge Claghorn2018-01-035-23/+15
|
* Exclude ActiveStorage::SetBlob from API docs [ci skip]George Claghorn2018-01-021-1/+1
|
* Restore support for the -layers transformationGeorge Claghorn2018-01-023-14/+22
|
* Merge pull request #31606 from yhirano55/bump_license_years_for_2018Arun Agrawal2017-12-312-2/+2
|\ | | | | Bump license years for 2018
| * Bump license years for 2018Yoshiyuki Hirano2017-12-312-2/+2
| |
* | Expose ActiveStorage::Analyzer#logger in API docs [ci skip]George Claghorn2017-12-311-1/+1
| | | | | | | | Clarify that it's public API and may be used in third-party analyzers.
* | Expose ActiveStorage::Previewer#logger in API docs [ci skip]George Claghorn2017-12-311-2/+2
| | | | | | | | Clarify that it's public API intended for use by third-party previewers. It shouldn't be removed without deprecation even though it isn't used by the built-in previewers.