Commit Graph

19 Commits

Author SHA1 Message Date
George Claghorn 8228d12a43 Delete dependent attachments with record
[Matt Jones & George Claghorn]
2018-03-05 15:57:52 -05:00
George Claghorn ccac681122 Generate root-relative paths in Active Storage disk service URL methods
Fixes #32129.
2018-03-05 11:54:43 -05:00
George Claghorn 6fb3ac1536 Provide a sensible default host 2018-01-16 20:32:02 -05:00
George Claghorn c2ba530c43
Extract content types from blob data 2018-01-15 13:06:17 -05:00
George Claghorn 2d20a7696a Fix direct uploads to local service
Disable CSRF protection for ActiveStorage::DiskController#update. The local disk service is intended to imitate a third-party service like S3 or GCS, so we don't care where direct uploads originate: they’re authorized by signed tokens.

Closes #30290.

[Shinichi Maeshima & George Claghorn]
2017-11-20 10:54:46 -05:00
George Claghorn 704a7e425c Preserve existing metadata when analyzing a blob
Closes #31138.
2017-11-13 16:36:39 -05:00
George Claghorn 605484079d Extract metadata from images and videos 2017-10-22 13:16:59 -04:00
bogdanvlviv 19323d3bcc
Use `require_relative` instead of `require` with full path in activestorage/
Related to #29417
2017-10-13 21:26:57 +03:00
bogdanvlviv f1e47b0348
Define path with __dir__ in activestorage/
Related to #29176
2017-10-13 20:47:56 +03:00
George Claghorn d30586211b Preview PDFs and videos 2017-09-28 16:43:37 -04:00
Jon Moss 07a13f7abb Use nil Logger for tests
Makes tests much more quietly, as opposed to the enormous amount of
logging that appears right now. This setting is used in AJ, as well as
other frameworks.

Output from test run:

```

.........................................................

Finished in 3.003355s, 18.9788 runs/s, 45.2827 assertions/s.
57 runs, 136 assertions, 0 failures, 0 errors, 0 skips
```
2017-08-17 09:47:23 -04:00
Koichi ITO d02844f249 Use frozen string literal in Active Storage 2017-08-12 21:43:42 +09:00
Rafael França 8562404c6b Merge pull request #30113 from dixpac/remove_unecessary_require_in_test_helper
ActiveStorage: Remove unnecessary require in test_helper
2017-08-11 17:35:18 -04:00
George Claghorn e43ba973a3 Run Active Storage tests in CI (#30144) 2017-08-10 15:58:30 -04:00
dixpac e1f1213c8b Remove unecessary require in test_helper 2017-08-09 08:45:15 +02:00
dixpac d44e737a76 Filter out Minitest backtrace.
Filter out Minitest backtrace while allowing backtrace from other
libraries to be shown.
2017-08-07 11:40:20 +02:00
claudiob 8b20789cfc Let ActiveStorage tests pass only for Disk
If you have a "service/configurations.yml" file, but every single line is
commented out, then an error occurs when running tests:

```
git:active-storage-import~/code/rails/activestorage$ rake
~/code/rails/activestorage/test/test_helper.rb:17:in `<top (required)>': undefined method `deep_symbolize_keys' for false:FalseClass (NoMethodError)
	from ~/code/rails/activestorage/test/controllers/direct_uploads_controller_test.rb:1:in `require'
```

The reason is that `YAML.load(..an empty file content..)` simply returns `false`, and not `{}`.

This PR fixes this behavior so tests can also run when no remote service
is available.
2017-08-01 09:06:39 -07:00
David Heinemeier Hansson a9cb1968b6 Setup travis to be able to run CI tests against S3 2017-07-31 17:51:16 -05:00
Rafael Mendonça França 9330d01ada Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'
git-subtree-dir: activestorage
git-subtree-mainline: 0d58e7e478
git-subtree-split: 3f4a7218a4
2017-07-31 15:21:22 -04:00