aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
Commit message (Collapse)AuthorAgeFilesLines
...
* | Delete dependent attachments with recordGeorge Claghorn2018-03-053-2/+17
| | | | | | | | [Matt Jones & George Claghorn]
* | Correct the ActiveStorage::Service#download_chunk docs [ci skip]George Claghorn2018-03-051-1/+1
| |
* | Generate root-relative paths in Active Storage disk service URL methodsGeorge Claghorn2018-03-0514-55/+66
| | | | | | | | Fixes #32129.
* | Handle another case where a blob might be erroneously purgedGeorge Claghorn2018-03-042-5/+22
| |
* | Avoid purging attached blob when replacing it with itselfGeorge Claghorn2018-03-042-2/+18
| |
* | Merge Previews/Variants controller into one Representations controller.Kasper Timm Hansen2018-03-037-100/+74
| | | | | | | | | | | | | | | | | | Since ActiveStorage::Blob::Representable unifies the idea of previews and variants under one roof as representation, we may as well have the controllers follow suit. Thus ActiveStorage::RepresenationsController enters the fray. I've copied the old tests for both previews and variants and unified those as well.
* | Deprecate `active_support/core_ext/hash/compact`yuuji.yaginuma2018-03-021-2/+0
| | | | | | | | | | Ruby 2.4+ provides `Hash#compact` and `Hash#compact!` natively, so `active_support/core_ext/hash/compact` is no longer necessary.
* | Rebuild activestorage.jsGeorge Claghorn2018-02-281-1/+1
| |
* | Handle file checksumming errorsGeorge Claghorn2018-02-281-0/+6
| |
* | Clear Blob's type before sending itGeorge Claghorn2018-02-262-2/+2
| | | | | | | | Prevent older versions of Chrome from appending a Content-Type header containing the Blob type, rendering the request invalid if we intend not to provide a Content-Type. This behavior was observed in Chrome 58.
* | Update test to reflect direct upload header changesGeorge Claghorn2018-02-261-1/+1
| |
* | Avoid specifying content types for direct uploads to Google Cloud StorageGeorge Claghorn2018-02-262-6/+5
| | | | | | | | Fix customizing the download Content-Type for a directly-uploaded blob via a signed URL. See e8286ee.
* | Remove changelogs for Rails 6.0 since they were backported to `5-2-stable`bogdanvlviv2018-02-261-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove railties' changelog added by 7340596de45dc4c0f62a287b6acc4e71d8ee6c60 since it was backported to `5-2-stable` via ac99916fcf7bf27bb1519d4f7387c6b4c5f0463d Remove activesupport's changelog added by 1077ae96b34b5a1dfbf10ee0c40b1ceb1eb6b30b since it was backported to `5-2-stable` via a2b97e4ffef971607a1be8fc7909f099b6840f36 Remove activesupport's changelog added by 0d41a76d0c693000005d79456dee7f9299f5e8d4 since it was backported to `5-2-stable` via cdce6a709e1cbc98fff009effc3b1b3ce4c7e8db Remove activestorage's changelog added by d57c52a385eb57c6ce8c6d124ab5e186f931d142 since it was backported to `5-2-stable` via 5292cdf59a2052c453d6016c69b90b790cbf2547 Follow up c113bdc9d0c2cffd535ca97aff85c4bdc46b11f6
* | Use lazy load hook to configure ActiveStorage::BlobEugene Kenny2018-02-252-1/+3
| | | | | | | | | | | | | | | | | | `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.
* | Support varying ICO filesGeorge Claghorn2018-02-244-2/+21
| | | | | | | | Closes #32096.
* | Allow S3 tests against buckets in other regionsAndrew White2018-02-212-2/+2
| | | | | | | | | | Only us-east-1 gives URLs like bucket.s3.amazonaws.com whereas other regions have URLs like s3-eu-west-1.amazonaws.com/ubxd-rails
* | Hoist update for clarityGeorge Claghorn2018-02-202-8/+8
| |
* | Undocument ActiveStorage::IdentificationGeorge Claghorn2018-02-201-1/+1
| |
* | Correct Range header syntaxGeorge Claghorn2018-02-201-1/+1
| |
* | Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-172-1/+8
| | | | | | | | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* | Clean up and consolidate .gitignoresbogdanvlviv2018-02-171-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Global ignores at toplevel .gitignore * Component-specific ignores in each toplevel directory * Remove `actionview/test/tmp/.keep` for JRuby ``` rm actionview/test/tmp/ -fr cd actionview/ bundle exec jruby -Itest test/template/digestor_test.rb ``` Related to #11743, #30392. Closes #29978.
* | 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
|