Commit Graph

683 Commits

Author SHA1 Message Date
George Claghorn
4e68525e33 Add missing word [ci skip] 2017-09-20 15:35:01 -04:00
George Claghorn
91edf754c4 Flesh out ActiveStorage::Filename docs 2017-09-20 15:34:04 -04:00
Eileen M. Uchitelle
e7f39af3fa Merge pull request #30629 from yhirano55/add_scope_to_has_one_attached_macro
Add `with_attached_*` scope to `has_one_attached` macro
2017-09-20 13:04:00 -04:00
Yoshiyuki Hirano
704bf9b9c6 Add with_attached_* scope to has_one_attached macro
* For avoiding N+1 problem, added `with_attached_*` scope to
  `has_one_attached` macro.
2017-09-19 06:02:00 +09:00
Yoshiyuki Hirano
0993cbe3e0 Remove unused require in ActiveStorage::Variation 2017-09-18 09:13:00 +09:00
Ryuta Kamizono
2402dd5588 Merge pull request #30628 from yhirano55/add_local_option_to_message_form
Add local option to Message form [ci skip]
2017-09-17 22:29:02 +09:00
Yoshiyuki Hirano
7d14bda3a7 Fix file missing in activestorage's example code [ci skip]
* File.open("~/face.jpg") raise error:
  `Errno::ENOENT: No such file or directory @ rb_sysopen - ~/face.jpg`
2017-09-17 21:00:23 +09:00
Yoshiyuki Hirano
194a93385b Add local option to Message form [ci skip]
* MessagesController redirects to `GET /message/:id`.
* It looks it don't expect XHR request.
* `form_with` behaves for XHR by default.
* I've added `local: true` option to `form_with`.
2017-09-17 17:44:04 +09:00
yuuji.yaginuma
3bf95f9513 Don't expose Active Storage routes
These routes are only used internally in Active Storage, and it seems
that there is no need for the user to directly use them.

Therefore, I think that routes should not be exposed to users.
2017-09-16 14:54:51 +09:00
George Claghorn
cffa32f95d Avoid making HTTP requests to generate signed URLs for GCS objects 2017-09-13 22:44:04 -04:00
_N_I_X_O_N_
c06b614c12 Fix activestorage direct upload on firefox
Direct upload on firefox is not working because it can’t handle click
events on “input[type=submit]”.
After a successful upload we can see on console a xml parse error, it
happens because AWS S3 success body response is empty, so changing the
reponseType suppress this error.
2017-09-12 18:45:23 +00:00
George Claghorn
21e690cba8 Rename activestorage/test/service/configurations.yml to activestorage/test/service/configurations.example.yml 2017-09-11 18:06:08 -04:00
David Heinemeier Hansson
69f976b859 Add credentials using a generic EncryptedConfiguration class (#30067)
* WIP: Add credentials using a generic EncryptedConfiguration class

This is sketch code so far.

* Flesh out EncryptedConfiguration and test it

* Better name

* Add command and generator for credentials

* Use the Pathnames

* Extract EncryptedFile from EncryptedConfiguration and add serializers

* Test EncryptedFile

* Extract serializer validation

* Stress the point about losing comments

* Allow encrypted configuration to be read without parsing for display

* Use credentials by default and base them on the master key

* Derive secret_key_base in test/dev, source it from credentials in other envs

And document the usage.

* Document the new credentials setup

* Stop generating the secrets.yml file now that we have credentials

* Document what we should have instead

Still need to make it happen, tho.

* [ci skip] Keep wording to `key base`; prefer defaults.

Usually we say we change defaults, not "spec" out a release.

Can't use backticks in our sdoc generated documentation either.

* Abstract away OpenSSL; prefer MessageEncryptor.

* Spare needless new when raising.

* Encrypted file test shouldn't depend on subclass.

* [ci skip] Some woordings.

* Ditch serializer future coding.

* I said flip it. Flip it good.

* [ci skip] Move require_master_key to the real production.rb.

* Add require_master_key to abort the boot process.

In case the master key is required in a certain environment
we should inspect that the key is there and abort if it isn't.

* Print missing key message and exit immediately.

Spares us a lengthy backtrace and prevents further execution.

I've verified the behavior in a test app, but couldn't figure the
test out as loading the app just exits immediately with:

```
/Users/kasperhansen/Documents/code/rails/activesupport/lib/active_support/testing/isolation.rb:23:in `load': marshal data too short (ArgumentError)
	from /Users/kasperhansen/Documents/code/rails/activesupport/lib/active_support/testing/isolation.rb:23:in `run'
	from /Users/kasperhansen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:830:in `run_one_method'
	from /Users/kasperhansen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest/parallel.rb:32:in `block (2 levels) in start'
```

It's likely we need to capture and prevent the exit somehow.
Kernel.stub(:exit) didn't work. Leaving it for tomorrow.

* Fix require_master_key config test.

Loading the app would trigger the `exit 1` per require_master_key's
semantics, which then aborted the test.

Fork and wait for the child process to finish, then inspect the
exit status.

Also check we aborted because of a missing master key, so something
else didn't just abort the boot.

Much <3 to @tenderlove for the tip.

* Support reading/writing configs via methods.

* Skip needless deep symbolizing.

* Remove save; test config reader elsewhere.

* Move secret_key_base check to when we're reading it.

Otherwise we'll abort too soon since we don't assign the secret_key_base
to secrets anymore.

* Add missing string literal comments; require unneeded yaml require.

* ya ya ya, rubocop.

* Add master_key/credentials after bundle.

Then we can reuse the existing message on `rails new bc4`.

It'll look like:

```
Using web-console 3.5.1 from https://github.com/rails/web-console.git (at master@ce985eb)
Using rails 5.2.0.alpha from source at `/Users/kasperhansen/Documents/code/rails`
Using sass-rails 5.0.6
Bundle complete! 16 Gemfile dependencies, 72 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Adding config/master.key to store the master encryption key: 97070158c44b4675b876373a6bc9d5a0

Save this in a password manager your team can access.

If you lose the key, no one, including you, can access anything encrypted with it.

      create  config/master.key
```

And that'll be executed even if `--skip-bundle` was passed.

* Ensure test app has secret_key_base.

* Assign secret_key_base to app or omit.

* Merge noise

* Split options for dynamic delegation into its own method and use deep symbols to make it work

* Update error to point to credentials instead

* Appease Rubocop

* Validate secret_key_base when reading it.

Instead of relying on the validation in key_generator move that into
secret_key_base itself.

* Fix generator and secrets test.

Manually add config.read_encrypted_secrets since it's not there by default
anymore.

Move mentions of config/secrets.yml to config/credentials.yml.enc.

* Remove files I have no idea how they got here.

* [ci skip] swap secrets for credentials.

* [ci skip] And now, changelogs are coming.
2017-09-11 20:21:20 +02:00
Yuji Yaginuma
83bfe07583 Use v3 of the AWS SDK 2017-09-09 23:22:10 -04:00
George Claghorn
eba7f85867 Accept GCS client options 2017-09-01 23:13:12 -04:00
George Claghorn
2cd8ac1b68 Have attachments touch their records 2017-08-31 20:10:56 -04:00
Rosa Gutierrez
390840eb4e
Ignore files already deleted on GCS file deletions
Relying on the GET request issued first to fetch the file we want to
delete is not enough to avoid this error. If the file is deleted after
our GET request but before the DELETE request we'll get a NotFound error
that after all means that the file is already deleted, so it can be
safely ignored.
2017-08-31 18:56:55 +02:00
George Claghorn
29db6b3cb2 Refactor 2017-08-29 18:30:45 -04:00
George Claghorn
656ee8b2dd Fix replacing a singular attachment 2017-08-29 15:34:50 -04:00
Yoshiyuki Hirano
e38900b845 Update Active Storage docs [ci skip] 2017-08-30 02:40:03 +09:00
George Claghorn
d3e7dc6f16 Synchronously destroy attachments 2017-08-29 00:02:59 -04:00
Koichi ITO
9e470b24c8 Fix order of Active Storage DiskService URL parameters
`content_type` parameter is before `disposition` parameter.
2017-08-26 23:16:07 +09:00
Yoshiyuki Hirano
0196ac6654 Enable links in Active Storage docs [ci skip] 2017-08-26 05:47:26 +09:00
Yoshiyuki Hirano
7ba922bb48 Fix link in doc for active storage [ci skip] 2017-08-25 22:44:46 +09:00
George Claghorn
9de6c6c91c Widen blob size column 2017-08-24 09:37:04 -04:00
Rafael Mendonça França
783295f706 Merge pull request #30213 from ckundo/ccundiff-alt-text-default
Do not generate default alt text for images
2017-08-23 11:51:34 -04:00
bogdanvlviv
92431ea5fb
Use 5.2 version of ActiveRecord::Migration for Active Storage 2017-08-22 17:32:43 +03:00
Kasper Timm Hansen
fabac4fe02 Merge pull request #30356 from bogdanvlviv/remove-frozen_string_literal-from-blob-migration
Remove frozen_string_literal comment from activestorage's migration
2017-08-22 13:02:43 +02:00
bogdanvlviv
43f452f23b
Remove frozen_string_literal comment from activestorage's migration
The activestorage's migration is used as template for apps
Related to #30348
2017-08-22 08:32:27 +03:00
George Claghorn
446814c3b8 Add frozen string literal pragma 2017-08-21 18:25:21 -04:00
George Claghorn
63395aba5a Encode Content-Disposition filenames according to RFC 2231
Closes #30134.
2017-08-21 18:23:15 -04:00
George Claghorn
c7993299d9 Update regex 2017-08-20 18:58:19 -04:00
George Claghorn
332049d116 Fix tests 2017-08-20 18:45:39 -04:00
George Claghorn
e9468e3971 Fix syntax error 2017-08-20 18:26:56 -04:00
George Claghorn
376dd5c001 DRY 2017-08-20 18:09:44 -04:00
George Claghorn
8bd14971b9 Rename ActiveStorage::Filename#extname to extension_with_delimiter 2017-08-20 16:30:15 -04:00
bogdanvlviv
911d100899
Add executable file activestorage/bin/test
```
rails$ cd activestorage/
rails/activestorage$ bin/test
........(compressed)....
rails/activestorage$ bin/test test/controllers/disk_controller_test.rb
.(compressed)..
rails/activestorage$ bin/test test/controllers/disk_controller_test.rb:42
.
```
2017-08-20 21:28:56 +03:00
Jon Moss
61a77f7c55 Remove Active Storage code climate config file
There's already a .codeclimate.yml file at the root of the project.
2017-08-18 11:00:07 -04:00
Cameron Cundiff
9a74c7b99b Do not generate default alt text in image tags
- Auto-generating content from the filename of an image is not suitable
  alternative text; alt text that isn't fully considered can be
  distracting and fatiguing for screen readers users (blind, low vision,
  dyslexic people).
- Setting a filename fallback short circuits screen reader default
  behavior and configuration for blank descriptions.
- Setting poor defaults also creates false negatives for accessibility
  linting and testing software, that makes it harder to improve
  application accessibility.

***

- After this change, if authors leave images without alt text, screen
  readers will fallback to default behavior for missing alt text.
- Also with this change, Automated linting and testing tools will
  correctly generate warnings.

[Fixes #30096]
2017-08-17 16:13:15 -04:00
George Claghorn
d11d629feb Merge pull request #30292 from maclover7/jm-ast-purge
Add missing test for Blob#purge
2017-08-17 11:53:32 -04:00
Jon Moss
267fdcc4a4 Add missing test for Blob#purge 2017-08-17 11:09:33 -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
Ryuta Kamizono
4fd5ceb157 Merge pull request #30280 from koic/change_namespace_of_active_storage_rake_task
Change namespace of Active Storage rake task
2017-08-16 22:04:41 +09:00
Koichi ITO
7698500b6e Change namespace of Active Storage rake task 2017-08-16 19:20:22 +09:00
Koichi ITO
7c260ae201 Fix RuboCop offenses
And enable `context_dependent` of Style/BracesAroundHashParameters cop.
2017-08-16 17:55:25 +09:00
Xavier Noria
d8bf5d73c3 restores some double newlines deleted in ae87217
These were intentional, see

https://github.com/rails/rails/pull/30061#issuecomment-320068368
2017-08-15 22:01:24 +02:00
Xavier Noria
ae87217382 minor tweaks in Active Storage after a walkthrough 2017-08-15 18:50:46 +02:00
George Claghorn
3cfadd5fa2 Move test to its proper place
ActiveStorage::Filename is a model, so its test case belongs in test/models.
2017-08-14 16:04:11 -04:00
George Claghorn
3841fdc4e7 Run Active Storage service tests in CI 2017-08-14 13:48:17 -04:00
Koichi ITO
2b6e85c190 Should escape regexp wildcard character . 2017-08-14 22:17:50 +09:00
Matthew Draper
4ec5b7610d Merge pull request #30211 from koic/frozen_activestorage
Use frozen string literal in Active Storage
2017-08-13 21:39:38 +09:30
Ryuta Kamizono
4966b36d4c Use references to respect primary key type in active storage tables
If created active storage tables by mysql2 or postgresql adapters, a
primary key is defined as a bigint. It should be used `references` to
the reference columns to respect primary key type.
2017-08-13 13:40:39 +09:00
Koichi ITO
d02844f249 Use frozen string literal in Active Storage 2017-08-12 21:43:42 +09:00
Rafael França
4766b2da02 Merge pull request #30198 from betesh/activestorage-rack-test-uploaded-file
Activestorage rack test uploaded file
2017-08-11 17:46:02 -04:00
Rafael França
9804e4c30c Merge pull request #30147 from yhirano55/fix_trailing_blank_lines
[Active Storage] `rubocop -a --only Layout/TrailingBlankLines`
2017-08-11 17:36:22 -04: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
Rafael Mendonça França
1eb8f88028 Remove unnedded Active Storage installation steps
Active Storage was now merged to master and it is automatically
installed in a new application.
2017-08-11 17:19:04 -04:00
Rafael França
72e311c3db Merge pull request #30201 from kamipo/eval_active_storage_attached_name_only_once
Evaluate `@active_storage_attached_#{name}` only once
2017-08-11 14:54:47 -04:00
Rafael França
9774322246 Merge pull request #30202 from kamipo/add_null_false_to_active_storage_tables
Add `null: false` to Active Storage tables
2017-08-11 14:54:33 -04:00
Isaac Betesh
4287f089d3 Make activestorage treat Rack::Test::UploadedFile just like ActionDispatch::Http::UploadedFile 2017-08-11 14:43:19 -04:00
Ryuta Kamizono
d76b2f9e55 Add null: false to Active Storage tables
These columns aren't intended nullable.
2017-08-12 02:33:38 +09:00
Anton Khamets
e25466b142 Enable browser caching for blobs and variants (#30196) 2017-08-11 13:18:12 -04:00
Ryuta Kamizono
bef99313e9 Evaluate @active_storage_attached_#{name} only once
Currently `"@active_storage_attached_#{name}"` in `define_method` is
evaluated every call. It is better to evaluate it only once.
2017-08-12 01:59:36 +09:00
Ryuta Kamizono
de80aa6412 Microsoft Azure --> Microsoft Azure Storage [ci skip] 2017-08-12 01:20:23 +09:00
Koichi ITO
d90f261562 Fix formatting of Active Storage docs [ci skip]
Follow up of #30188.
2017-08-11 13:15:23 +09:00
yuuji.yaginuma
8458dbfa00 Fix formatting of Active Storage docs [ci skip]
* Use `+` instead of backquote.
* Remove escape from class to be link
2017-08-11 10:21:40 +09:00
George Claghorn
e43ba973a3 Run Active Storage tests in CI (#30144) 2017-08-10 15:58:30 -04:00
Dino Maric
a3f7407e7c Isolate ActiveStorage namespaces (#30095)
* Isolate ActiveStorage namespaces

* Rename migrations task

[Rafael Mendonça França + Dino Maric]
2017-08-10 14:02:29 -04:00
qsona
7cfa80f812 Fix a typo 2017-08-10 12:11:28 +09:00
dixpac
e1f1213c8b Remove unecessary require in test_helper 2017-08-09 08:45:15 +02:00
Yoshiyuki Hirano
d9a283500f [Active Storage] rubocop -a --only Layout/TrailingBlankLines 2017-08-09 14:31:15 +09:00
Rafael França
96bcaedf1d Merge pull request #30112 from dixpac/filter_minitest_backtrace
ActiveStorage:Filter out Minitest backtrace.
2017-08-08 18:38:25 -04:00
Rafael França
673fb4c433 Merge pull request #30118 from georgeclaghorn/active-storage-load-hooks
Set ActiveStorage::Blob.service when ActiveStorage::Blob is loaded
2017-08-08 17:10:58 -04:00
George Claghorn
caf7e62301 Set ActiveStorage::Blob.service when ActiveStorage::Blob is loaded
Fixes that ActiveStorage::Blob.service is unset when ActiveStorage::Blob
is reloaded.
2017-08-08 14:56:27 -04:00
Rafael Mendonça França
1422e9f9c9 Merge pull request #30135 from ffmike/azure-storage-fix-content-type
Support content_type in AzureStorageService#url
2017-08-08 14:42:03 -04:00
Dino Maric
4b72bee47b ActiveStorage:Add migrations per rails engine conventions (#30111)
* Add migrations per rails engine conventions

* Fix failing tests
2017-08-08 09:47:38 -05:00
Mike Gunderloy
6ef3794013
Support content_type in AzureStorageService#url
Add in the content_type option, which is defined as part of the generic
ActiveStorage::Service class.

Without this option, attempts to generate a URL for an attached file
fail with "ArgumentError (unknown keyword: content_type)"
2017-08-08 09:35:42 -05:00
Anton Khamets
7c89948c41 Extend image_tag to accept ActiveStorage Attachments and Variants (#30084)
* Extend image_tag to accept ActiveStorage's Attachments and Variants

* Flip resolve_image_source around

* Add tests for the new use-cases of image_tag

* Remove the higher-level test

* Update image_tag documentation

* Add error states into the test suite

* Re-raise polymorhic_url's NoMethodError as ArgumentError

* delegate_missing_to will raise DelegationError instead of NoMethodError
2017-08-07 09:38:51 -05: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
bogdanvlviv
ee0378b638
Active Storage to 5.2.0.alpha inside activestorage/package.json
Follow #30083
2017-08-06 17:23:07 +00:00
Vipul A M
1fe55e94b7 Pass over Active Storage readme [ci skip] (#30086) 2017-08-06 13:44:45 +05:30
David Heinemeier Hansson
616f3611d5 Merge branch 'master' into ast-module 2017-08-05 09:11:02 -05:00
David Heinemeier Hansson
6df24c693e Merge pull request #30068 from kamipo/user_start_with_than_regexp
Use `content_type.start_with?("...")` than `content_type =~ /^.../`
2017-08-05 09:07:38 -05:00
David Heinemeier Hansson
b360f07bd2 Merge pull request #30081 from y-yagi/fix_ruby_warnings
Fix ruby warnings
2017-08-05 09:07:07 -05:00
David Heinemeier Hansson
ea5c99dce1 Merge pull request #30080 from georgeclaghorn/active-storage-secret-key-base
Active Storage: check for `app.secrets.secret_key_base`, not `app.config.secret_key_base`
2017-08-05 09:06:32 -05:00
David Heinemeier Hansson
1c96ca2d44 Merge pull request #30083 from koic/change_gem_version_of_active_storage_to_5_2_0
Change gem version of Active Storage to 5.2.0.alpha
2017-08-05 09:05:25 -05:00
George Claghorn
1ab1f87596 Check for app.secrets.secret_key_base, not app.config.secret_key_base
By default, apps only have the former set.
2017-08-05 10:03:53 -04:00
dixpac
2b9e04b6f9 Remove unecesarry exception variable 2017-08-05 14:05:18 +02:00
Koichi ITO
10a7ae39c6 Change gem version of Active Storage to 5.2.0.alpha 2017-08-05 14:24:31 +09:00
yuuji.yaginuma
46db463d06 Fix ruby warnings
This fixes following warnings:

```
test/models/variant_test.rb:11: warning: ambiguous first argument; put parentheses or a space even after `/' operator
lib/active_storage/attached/macros.rb:63: warning: instance variable @active_storage_attached_highlights not initialized
lib/active_storage/attached/macros.rb:25: warning: instance variable @active_storage_attached_avatar not initialized
```
2017-08-05 12:22:39 +09:00
claudiob
bb7599a6c8 module ActiveStorage, not ActiveStorage::Class
The reasons for this commit are:

- uniformity with the other Rails libraries
- (possibly) behave better with respect to autoloading
- fix the index in the generated documentation

Before this commit, run `rake rdoc` generates this left sidebar
(ActiveStorage entries are indexed twice, both inside and outside the module):

<img width="308" alt="before" src="https://user-images.githubusercontent.com/10076/28939523-7c087dec-7846-11e7-9289-38ed4a2930cd.png">

After this commit, run `rake rdoc` generates this left sidebar:
(ActiveStorage entries are only indexed inside the module):

<img width="303" alt="after" src="https://user-images.githubusercontent.com/10076/28939524-7c090be0-7846-11e7-8ee5-29dfecae548e.png">
2017-08-04 16:40:10 -07:00
yuuji.yaginuma
70d0e53db7 Fix repository URL [ci skip]
changed `rails/activestorage` to `rails/rails`.
2017-08-05 08:25:29 +09:00
Ryuta Kamizono
6768390a42 Use content_type.start_with?("...") than content_type =~ /^.../
`start_with?` is a little faster than regexp for prefix matching by a
fixed string.
2017-08-05 08:10:13 +09:00
Dino Maric
3179f089be Rename Azure to AzureStorage (#30057) 2017-08-04 17:57:02 -05:00
Claudio B
b9f0eb24ed Fix tests for AWS buckets that include a . (#30059)
If an AWS bucket name includes a `.` (e.g. `bucket.name`), then the canonical
URL for an object will start with "https://s3.amazonaws.com/bucket.name/"
and not with "https://bucket.name.s3.amazonaws.com/".

The URL tests have now been separated into two separate asserts, to ensure
that both the "s3.amazonaws.com" and the "bucket.name" components are included,
but not specifically in that order.
2017-08-04 17:56:14 -05:00
Rafael Mendonça França
77be872819 Do not change the entire codebase style only because of active_storage
We are already removing the braces around hash parameters in the last
argument in other places so we should not change the entire codebase
because of two places.
2017-08-03 17:45:58 -04:00
Rafael Mendonça França
b76f4e47e8 Fix all rubocop violations 2017-08-03 17:32:59 -04:00
Rafael França
66e5bf9d07 Merge pull request #30061 from claudiob/ast-rubocop
Make Rubocop happy about ActiveStorage
2017-08-03 17:24:45 -04:00
Rafael Mendonça França
5bfff1de54 We need to require the top file before individual one 2017-08-03 17:02:43 -04:00
Rafael Mendonça França
f601a01b2c Do not eager load ActiveRecord::Base
Everything inside the app directory of a engine is autoload/eager loaded automatically so we don't need to require them.
2017-08-03 16:57:48 -04:00
Rafael Mendonça França
da44e858ca There is no reason to single line methods here
I know those methods are unlikely to change but having one line method
is hard to read and also hard to modify.
2017-08-03 15:23:28 -04:00
claudiob
9d636c9e2f Make Rubocop happier about ActiveStorage
Running `rubocop activestorage` before this commit resulted in 20 offenses.
This commit only fixes:

- Trailing whitespace detected
- Space inside } missing
- Put one space between the method name and the first argument.

The other offenses are left since they are intentional according to
@georgeclaghorn (https://github.com/rails/rails/pull/30061#issuecomment-319999190)
2017-08-03 11:43:08 -07:00
David Heinemeier Hansson
624b6c210f Can't initialize a message verifier without a key base 2017-08-03 10:01:35 -05:00
Mike Gunderloy
c5ae4e52e3 Tweak requires
Omit azure-core (it's required by azure-storage), remove require:false to match other points.
2017-08-02 20:47:58 -05:00
Mike Gunderloy
d4f0b10319 Use release azure-core gem 2017-08-02 20:32:09 -05:00
Mike Gunderloy
0f2d3fb6da Update README.md 2017-08-02 19:55:10 -05:00
Mike Gunderloy
8aa742ff52 Add Azure gems to README 2017-08-02 18:29:51 -05:00
Ryuta Kamizono
815d1abf39 Fix Style/StringLiterals violations for Active Storage
```
% be rubocop -a --only Style/StringLiterals activestorage
Inspecting 74 files
........................................CCCCCCCCCC.C........CC.......C.C..

(snip)

74 files inspected, 31 offenses detected, 31 offenses corrected
```
2017-08-03 03:13:11 +09:00
Rolandas Barysas
b334ac80cf Add Azure to the available services list 2017-08-02 10:28:51 +03:00
Bryan Lim
f927de6fef Add Azure to readme
previously https://github.com/rails/activestorage/pull/86
2017-08-02 09:57:19 +08:00
David Heinemeier Hansson
ff3dad07ba Skip if credentials aren't provided 2017-08-01 17:22:20 -05:00
David Heinemeier Hansson
4f8be04f4e Fix dummy app for inclusion in Rails 2017-08-01 17:22:10 -05:00
David Heinemeier Hansson
13882d0067 Remove circular dependency 2017-08-01 17:12:57 -05:00
David Heinemeier Hansson
1ea49d68ff Follow same format as action_cable 2017-08-01 16:50:53 -05:00
David Heinemeier Hansson
b807b5b7e8 Cut down on installation advice 2017-08-01 16:28:05 -05:00
David Heinemeier Hansson
c622e532fc Drop README terms no longer relevant 2017-08-01 16:26:13 -05:00
David Heinemeier Hansson
e98eceb076 Rely on top-level files 2017-08-01 16:23:37 -05:00
Guillermo Iguaran
d66fadeb67 Merge pull request #30030 from claudiob/only-disk
Let ActiveStorage tests pass only for Disk
2017-08-01 13:05:23 -05:00
claudiob
98bb99ef61 Don't depend on HTTParty
"httparty" is only added in #30020 to write two tests to make PUT requests
against S3 and GCS.

The same requests can be made with net/http, removing a dependency from the Gemfile.
2017-08-01 10:56:39 -07: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
David Heinemeier Hansson
ba12811db2 Move the direct_upload: true convenience option from the activestorage helper into actionview 2017-07-31 16:23:37 -05:00
David Heinemeier Hansson
5beb87c7b1 Move to new storage.yml location 2017-07-31 16:18:39 -05:00
David Heinemeier Hansson
bb69b3e047 Directory and config installation now done by app_generator 2017-07-31 16:12:39 -05:00
David Heinemeier Hansson
9d1268375c Fix gitignore to be relative 2017-07-31 15:59:04 -05:00
David Heinemeier Hansson
a1a363a8aa Follow form from actioncable 2017-07-31 15:57:56 -05:00
David Heinemeier Hansson
90a8e0698d Use config/storage.yml as part of the skeleton and loading 2017-07-31 15:57:37 -05:00
David Heinemeier Hansson
54663f55ef Resolve gemspec typo 2017-07-31 15:55:55 -05:00
David Heinemeier Hansson
9e502959c0 No longer used 2017-07-31 15:54:17 -05:00
David Heinemeier Hansson
16d00247f3 Bring activestorage dependencies into the general Gemfile 2017-07-31 15:53:09 -05:00
David Heinemeier Hansson
253757ddcb Initialize changelog 2017-07-31 15:52:39 -05:00
David Heinemeier Hansson
4b5e042d79 Use standard Rails layout for gemspec 2017-07-31 15:52:31 -05:00
Rafael Mendonça França
9330d01ada Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'
git-subtree-dir: activestorage
git-subtree-mainline: 0d58e7e478e79c2d6b2a39a4444d2a17a903b2a6
git-subtree-split: 3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58
2017-07-31 15:21:22 -04:00