aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage
Commit message (Collapse)AuthorAgeFilesLines
* Output junit format test reportFumiaki MATSUSHIMA2019-04-041-0/+2
|
* url -> URL where apt except inside actionpack/Sharang Dashputre2019-04-014-8/+8
|
* Revert "Add ActiveStorage.service_configurations and ActiveStorage.service"George Claghorn2019-03-314-36/+30
| | | | This reverts commit 002684e36e813469c3585e193f0698784c88278b.
* Add ActiveStorage.service_configurations and ActiveStorage.serviceGeorge Claghorn2019-03-314-30/+36
| | | | | | * Allow plugins to access the global service and alternative service configs before ActiveStorage::Blob loads. * Make ActiveStorage.service_configurations the default second argument to ActiveStorage::Service.configure. Plugins that just want to use an alternative service defined in config/storage.yml needn't pass in the config themselves.
* Require railties for all Active Storage dependenciesGeorge Claghorn2019-03-301-0/+4
|
* Specify Active Storage's dependency on Active JobGeorge Claghorn2019-03-301-1/+2
|
* Add load hook for ActiveStorage::AttachmentGeorge Claghorn2019-03-282-2/+4
|
* Add ActiveStorage::Service#openGeorge Claghorn2019-03-286-30/+32
|
* Traducir del: inglésEugeniu Tambur2019-03-191-1/+1
| | | | | 44/5000 Checking for the existence of only one table
* Fix for migration active_storage migrationEugeniu Tambur2019-03-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "active_storage_attachments" does not exist* Updating to rails 6.0.0.beta3 if the command rake app:update is used a new migration file is generated: ```ruby # db/migrate/add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0] def up unless foreign_key_exists?(:active_storage_attachments, column: :blob_id) add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id end end end ``` **If the project does not have previously installed active storage** this mgiration causes an error: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "active_storage_attachments" does not exist **Error output:** PG::UndefinedTable: ERROR: relation "active_storage_attachments" does not exist activerecord-6.0.0.beta3/lib/active_record/connection_adapters/postgresql/database_statements.rb:90:in `async_exec' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/postgresql/database_statements.rb:90:in `block (2 levels) in execute' activesupport-6.0.0.beta3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' activesupport-6.0.0.beta3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' activesupport-6.0.0.beta3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/postgresql/database_statements.rb:89:in `block in execute' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract_adapter.rb:643:in `block (2 levels) in log' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract_adapter.rb:642:in `block in log' activesupport-6.0.0.beta3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract_adapter.rb:633:in `log' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/postgresql/database_statements.rb:88:in `execute' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract/schema_statements.rb:977:in `add_foreign_key' activerecord-6.0.0.beta3/lib/active_record/migration.rb:875:in `block in method_missing' activerecord-6.0.0.beta3/lib/active_record/migration.rb:843:in `block in say_with_time' activerecord-6.0.0.beta3/lib/active_record/migration.rb:843:in `say_with_time' activerecord-6.0.0.beta3/lib/active_record/migration.rb:864:in `method_missing' /db/migrate/20190315102607_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb:5:in `up' activerecord-6.0.0.beta3/lib/active_record/migration.rb:816:in `exec_migration' activerecord-6.0.0.beta3/lib/active_record/migration.rb:797:in `block (2 levels) in migrate' activerecord-6.0.0.beta3/lib/active_record/migration.rb:796:in `block in migrate' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' activerecord-6.0.0.beta3/lib/active_record/migration.rb:795:in `migrate' activerecord-6.0.0.beta3/lib/active_record/migration.rb:985:in `migrate' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1293:in `block in execute_migration_in_transaction' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1344:in `block in ddl_transaction' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract/database_statements.rb:265:in `block in transaction' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract/transaction.rb:272:in `block in within_new_transaction' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract/transaction.rb:270:in `within_new_transaction' activerecord-6.0.0.beta3/lib/active_record/connection_adapters/abstract/database_statements.rb:265:in `transaction' activerecord-6.0.0.beta3/lib/active_record/transactions.rb:212:in `transaction' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1344:in `ddl_transaction' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1292:in `execute_migration_in_transaction' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1264:in `block in migrate_without_lock' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1263:in `each' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1263:in `migrate_without_lock' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1211:in `block in migrate' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1364:in `with_advisory_lock' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1211:in `migrate' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1044:in `up' activerecord-6.0.0.beta3/lib/active_record/migration.rb:1019:in `migrate' activerecord-6.0.0.beta3/lib/active_record/tasks/database_tasks.rb:191:in `migrate' activerecord-6.0.0.beta3/lib/active_record/railties/databases.rake:78:in `block (3 levels) in <main>' activerecord-6.0.0.beta3/lib/active_record/railties/databases.rake:76:in `each' activerecord-6.0.0.beta3/lib/active_record/railties/databases.rake:76:in `block (2 levels) in <main>' railties-6.0.0.beta3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' railties-6.0.0.beta3/lib/rails/commands/rake/rake_command.rb:20:in `perform' railties-6.0.0.beta3/lib/rails/command.rb:48:in `invoke' railties-6.0.0.beta3/lib/rails/commands.rb:18:in `<main>' bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register' bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' activesupport-6.0.0.beta3/lib/active_support/dependencies.rb:297:in `block in require' activesupport-6.0.0.beta3/lib/active_support/dependencies.rb:263:in `load_dependency' activesupport-6.0.0.beta3/lib/active_support/dependencies.rb:297:in `require' bin/rails:4:in `<main>'
* GCS service: skip unnecessary bucket lookupsGeorge Claghorn2019-03-141-1/+1
|
* Merge tag 'v6.0.0.beta3'eileencodes2019-03-133-2/+7
|\ | | | | | | v6.0.0.beta3 release
| * Prep releaseeileencodes2019-03-113-2/+7
| | | | | | | | | | | | | | * Update RAILS_VERSION * Bundle * rake update_versions * rake changelog:header
* | Squish the deprecation messages across the codebasePrathamesh Sonpatki2019-03-112-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sample example -> Before: prathamesh@Prathameshs-MacBook-Pro-2 blog *$ rails server thin DEPRECATION WARNING: Passing the Rack server name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -u option instead. After: prathamesh@Prathameshs-MacBook-Pro-2 squish_app *$ rails server thin DEPRECATION WARNING: Passing the Rack server name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -u option instead.
* | Merge pull request #35559 from ↵Kasper Timm Hansen2019-03-091-0/+2
|\ \ | | | | | | | | | | | | ashishprajapati/ashishprajapati/important_textual_improvements Added missing guide links in documentation and minor wording fix
| * | Added missing guide links in README documentation and minor wording fix [ci ↵ashishprajapati2019-03-101-0/+2
| | | | | | | | | | | | skip]
* | | Fix links in gemspec and docs from http to https.Abhay Nikam2019-03-091-1/+1
| | |
* | | Updated links from http to https in guides, docs, etcAbhay Nikam2019-03-091-2/+2
|/ /
* | Decrypt the ASt test config if availableMatthew Draper2019-03-051-0/+8
| |
* | Merge pull request #35412 from abhchand/correctly-load-blob-associationGeorge Claghorn2019-02-263-0/+7
|\ \ | |/ |/| Ensure that the `_blob` association is properly loaded when attaching `::One`
| * [ActiveStorage] Ensure that the `_blob` association is properly loaded when ↵Abhishek Chandrasekhar2019-02-263-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attaching `::One` Consider a model with `One` and `Many` attachments configured: class User < ActiveRecord::Base has_one_attached :avatar has_many_attached :highlights end === One Attachment After attaching `One` attachment (`:avatar`), we can see that the associated `_blob` record (`:avatar_blob`) still returns as `nil`. user.avatar.attach(blob) user.avatar_attachment.present? => true user.avatar_blob.present? => false # Incorrect! This is a false negative. It happens because after the attachment and blob are built: 1. The record already has its `_blob` association loaded, as `nil` 2. the `::Attachment` is associated with the record but the `::Blob` only gets associated with the `::Attachment`, not the record itself In reality, the blob does in fact exist. We can verify this as follows: user.avatar.attach(blob) user.avatar_attachment.blob.present? => true # Blob does exist! The fix in this change is to simply assign the `::Blob` when assigning the `::Attachment`. After this fix is applied, we correctly observe: user.avatar.attach(blob) user.avatar_attachment.present? => true user.avatar_blob.present? => true # Woohoo! === Many Attachments We don't see this issue with `Many` attachments because the `_blob` association is already loaded as part of attaching more/newer blobs. user.highlights.attach(blob) user.highlights_attachments.any? => true user.highlights_blobs.any? => true
* | Preparing for 6.0.0.beta2 releaseRafael Mendonça França2019-02-253-2/+7
|/
* Add missing require to active_storage.rbEugene Kenny2019-02-201-0/+1
| | | | | | | Since b21f50d8ae36d9b50b673579e17bccbe55363b34, requiring active_storage on its own has failed with the following error: activestorage/lib/active_storage.rb:55:in `<module:ActiveStorage>': undefined method `minutes' for 5:Integer (NoMethodError)
* Delegated path_for to primary in the MirrorServiceAbhay Nikam2019-02-142-1/+5
|
* Allow configuring the Azure Storage service with extra client optionsgarytaylor2019-02-041-2/+2
|
* Merge pull request #35043 from simoleone/activestorage/s3/content-typeEileen M. Uchitelle2019-02-012-2/+20
|\ | | | | include the content type when uploading to S3
| * include the content type when uploading to S3Simo Leone2019-01-242-2/+20
| |
* | ActiveStorage typo fix.alkesh262019-01-311-1/+1
| |
* | Fix usage documentation in VideoAnalyzerCarlos Ramirez III2019-01-281-1/+1
| | | | | | The code snippet within the usage documentation comment used the wrong object namespace for the ActiveStorage::Analyzer::VideoAnalyzer
* | Add CHANGELOG entries for npm package renames [ci skip]Javan Makhmali2019-01-281-0/+6
| |
* | Prefer ImageProcessing's resize_to_limit macro over resize_to_fitGeorge Claghorn2019-01-245-12/+12
|/ | | | Don't upsize images smaller than the specified dimensions.
* Revert ensure external redirects are explicitly allowedGannon McGibbon2019-01-222-2/+2
|
* Fix ArgumentError: Unsafe redirectYuichi Takeuchi2019-01-214-2/+57
|
* Preparing for 6.0.0.beta1 releaseRafael Mendonça França2019-01-183-2/+4
|
* Merge pull request #33419 from bogdanvlviv/update-active_storageGeorge Claghorn2019-01-162-0/+14
|\ | | | | `rake app:update` should update active_storage
| * Add foreign key to active_storage_attachments for `blob_id` via new migrationbogdanvlviv2019-01-162-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need this in order to be able to add this migration for users that use ActiveStorage during update their apps from Rails 5.2 to Rails 6.0. Related to #33405 `rake app:update` should update active_storage `rake app:update` should execute `rake active_storage:update` if it is used in the app that is being updated. It will add new active_storage's migrations to users' apps during update Rails. Context https://github.com/rails/rails/pull/33405#discussion_r204239399 Also, see a related discussion in the Campfire: https://3.basecamp.com/3076981/buckets/24956/chats/12416418@1236713081
* | Minimize boilerplate setup code for JavaScript librariesJavan Makhmali2019-01-161-2/+1
|/
* Move all npm packages to @rails scopeJavan Makhmali2019-01-102-2/+2
| | | | Fixes #33083
* Revert "Revert "Merge pull request #34387 from ↵Kasper Timm Hansen2019-01-081-0/+3
| | | | | | | | yhirano55/rails_info_properties_json"" I reverted the wrong commit. Damn it. This reverts commit f66a977fc7ae30d2a07124ad91924c4ee638a703.
* Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json"Kasper Timm Hansen2019-01-081-3/+0
| | | | | | | | | | | We had a discussion on the Core team and we don't want to expose this information as a JSON endpoint and not by default. It doesn't make sense to expose this JSON locally and this controller is only accessible in dev, so the proposed access from a production app seems off. This reverts commit 8eaffe7e89719ac62ff29c2e4208cfbeb1cd1c38, reversing changes made to b6e4305c3bca4c673996d0af9db0f4cfbf50215e.
* Merge pull request #34132 from ConfusedVorlon/enable_fragment_cache_log_in_devRafael França2019-01-081-0/+1
|\ | | | | enable_fragment_cache_logging in dev by default
| * enable_fragment_cache_loggingRob Jonson2018-10-091-0/+1
| | | | | | | | | | | | | | | | fragment caching was refactored in (I think 5.2) and by default doesn't log cache info this is confusing in development where rails dev:cache now turns on caching, but doesn't show any different logging output better to enable debugging by default for dev - and let people turn it off if preferred
* | Permit sending Active Storage purge and analysis jobs to separate queuesGeorge Claghorn2019-01-016-3/+31
| |
* | Bump license years for 2019Arun Agrawal2018-12-312-2/+2
| |
* | Permit generating variants of TIFF imagesLuciano Sousa2018-12-304-0/+17
| |
* | Make Active Storage blob keys lowercaseJulik Tarkhanov2018-12-304-4/+24
| | | | | | Accommodate case-insensitive filesystems and database collations.
* | Use 6.0 default configs in Active Storage test dummy appbogdanvlviv2018-12-301-1/+1
| |
* | Don’t include an undefined X-CSRF-Token headerCameron Bothner2018-12-273-2/+15
| | | | | | | | | | | | | | If there is not a `csrf-token` meta tag in the document, the blob record XHR was including an `X-CSRF-Token` header set to the string "undefined." Instead of setting it to undefined, it should not be included in the absence of a meta tag.
* | Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin blockRyuta Kamizono2018-12-2111-280/+224
| | | | | | | | | | | | | | | | | | | | Currently we sometimes find a redundant begin block in code review (e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205). I'd like to enable `Style/RedundantBegin` cop to avoid that, since rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5 (https://bugs.ruby-lang.org/issues/12906), so we'd probably meets with that situation than before.
* | Module#{define_method,alias_method,undef_method,remove_method} become public ↵Ryuta Kamizono2018-12-212-2/+2
| | | | | | | | | | | | since Ruby 2.5 https://bugs.ruby-lang.org/issues/14133