Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Active Storage to Rails #30020

Merged
merged 396 commits into from
Aug 4, 2017
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
396 commits
Select commit Hold shift + click to select a range
03120ec
Disk storage: ensure URLs end with the blob filename since some user …
jeremy Jul 8, 2017
839834e
Merge pull request #22 from jeremy/disk-filename-url
dhh Jul 8, 2017
8f125d5
Merge pull request #21 from jeremy/disk-binary-io
dhh Jul 8, 2017
6116313
Mirror: explicit primary service and list of mirrors
jeremy Jul 8, 2017
e550339
Configure services that reference other services
jeremy Jul 8, 2017
f7f864c
Travis CI 💡
jeremy Jul 9, 2017
1a17cfb
Service: clarify Service.build arguments
jeremy Jul 9, 2017
4d292fc
Clarify how a service can build other composed services
jeremy Jul 9, 2017
f1489c2
Match new configurator needs
dhh Jul 9, 2017
41afdb6
Merge pull request #26 from jeremy/service-configurator
dhh Jul 9, 2017
01109dc
Use class methods scope now that we have multiple
dhh Jul 9, 2017
8561d67
Symbolize all keys inside configuration nested hash
dixpac Jul 9, 2017
a1a0680
Ensure binary encoding for downloading
dhh Jul 9, 2017
d361bef
Example of keyfile specification
dhh Jul 9, 2017
57fd9d2
Merge pull request #27 from dixpac/fix_configuration_keys_symbolization
dhh Jul 9, 2017
4bfe7af
Instrument and log the services
dhh Jul 9, 2017
5bb3f63
Test URL generation for S3 and Disk
dhh Jul 9, 2017
7593b77
Proper logging is now in place
dhh Jul 9, 2017
b1cf901
Copypasta comments
dhh Jul 9, 2017
a19d943
Direct uploads for S3
dhh Jul 9, 2017
f2f5c79
Accept sgids for existing blobs created via direct upload as an attac…
dhh Jul 9, 2017
18720bc
Add basic tests to the Configurator#build (#28)
dixpac Jul 9, 2017
bb2d7fc
Tests: Dir.mktmpdir neatly wraps up tmpdir + join
jeremy Jul 9, 2017
4994e1a
Configurator tests: work against test-local config
jeremy Jul 9, 2017
9cf3347
Scope aws-skd to version 2 (#34)
dixpac Jul 10, 2017
f66a690
Expose chunked downloads
georgeclaghorn Jul 10, 2017
53d5384
Depend on Rails > 5.1
georgeclaghorn Jul 11, 2017
f28f4e9
Revert "Depend on Rails > 5.1"
georgeclaghorn Jul 11, 2017
1966c18
Very incomplete first stab
dhh Jul 11, 2017
6d39624
S3: slim down service implementation (#40)
jeremy Jul 11, 2017
17906fd
Revert "S3: slim down service implementation (#40)" (#41)
dhh Jul 12, 2017
afb7047
Update GCSService#url
quartzmo Jul 12, 2017
c55af14
Merge pull request #42 from quartzmo/gcs-site-url
georgeclaghorn Jul 12, 2017
2a738b3
Remove few ivars from gcs_service implementation
dixpac Jul 13, 2017
50bec56
Merge pull request #43 from dixpac/small_gcs_service_refactoring
georgeclaghorn Jul 13, 2017
14e6386
Fix regular expression on s3 test URL generation test (#44)
dixpac Jul 13, 2017
6dcdc5c
Added rubocop / codeclimate config and fixed current offenses (#45)
cristianbica Jul 13, 2017
c49c56b
Revert back to the original implementaion with varaibles
dixpac Jul 14, 2017
52cfe86
Merge pull request #51 from dixpac/restore_intermediate_variables
georgeclaghorn Jul 14, 2017
62e5562
Don't fail on boot because of missing S3 keys when S3 is not used
Jul 14, 2017
ed977c3
Fail early if no storage service is specified
Jul 14, 2017
c178de5
Merge pull request #53 from colorfulfool/error-messages
georgeclaghorn Jul 14, 2017
a6df451
Depend on Rails >= 5.2.0.alpha
georgeclaghorn Jul 14, 2017
315bd5c
Fixing logger to work with Rails 5.2.0.alpha
SGospodinov Jul 15, 2017
2dba88c
Merge pull request #55 from SGospodinov/logger-for-5.2.0
georgeclaghorn Jul 15, 2017
a4e0e16
Put conditional back
georgeclaghorn Jul 15, 2017
4dd44bc
Allow custom endpoints for S3.
seanhandley Jul 14, 2017
147b409
Merge pull request #48 from seanhandley/hosted_s3
georgeclaghorn Jul 15, 2017
6074771
Swap branches
georgeclaghorn Jul 15, 2017
993283a
Fix a typo in S3Service
Jul 15, 2017
2cd1b88
Merge pull request #56 from colorfulfool/fix-s3-service
georgeclaghorn Jul 15, 2017
2f15938
Fix S3 direct upload test
georgeclaghorn Jul 16, 2017
94a450a
Splat options
georgeclaghorn Jul 16, 2017
be526d1
Add direct upload support to GCS service
michaelherold Jul 17, 2017
bb7b834
Remove unused require
georgeclaghorn Jul 17, 2017
c8ad7dc
Replace hard-coded S3 bucket name with configured bucket
jtperreault Jul 17, 2017
d0d4e33
Use descriptive new freeze_time helper
georgeclaghorn Jul 19, 2017
32331b1
Accept S3 upload options (e.g. server_side_encryption)
baerjam Jul 20, 2017
c2a61cc
Merge branch 'master' into variants
dhh Jul 20, 2017
710957b
Double confetti
dhh Jul 20, 2017
66d94ed
Easier access to the variant of a blob
dhh Jul 20, 2017
5dbe5ea
Follow AR like naming of factory method
dhh Jul 20, 2017
76395e3
Do real transformations in a safe way
dhh Jul 20, 2017
f1523ab
Use a unique blob variant key for storage
dhh Jul 20, 2017
dda0130
Use the direct accessor
dhh Jul 20, 2017
1a9026b
Extract routes.rb to engine location for auto configuration
dhh Jul 20, 2017
1c85eec
Move controllers to default engine location for auto loading
dhh Jul 20, 2017
6c2cef2
Fix-up variants controller
dhh Jul 20, 2017
af99968
Make processing an explicit step
dhh Jul 20, 2017
a968e3c
Consistent naming
dhh Jul 20, 2017
beb60b9
True is the same as no arguments
dhh Jul 20, 2017
986a71d
Add instruction to install the gem from the master (#65)
dixpac Jul 21, 2017
cbe8931
Better naming
dhh Jul 21, 2017
438d5cc
Accept that this is a full-Rails engine
dhh Jul 21, 2017
9ac31a3
Mount routes on the engine
dhh Jul 21, 2017
0c47740
Hacky way to mount routes for engine controller tests
dhh Jul 21, 2017
7f41111
Extract variation value object
dhh Jul 21, 2017
c695263
Precise naming
dhh Jul 21, 2017
67606dc
Over-indented
dhh Jul 21, 2017
796f833
Fix and test VariantsController
dhh Jul 21, 2017
dd3eced
Proper require
dhh Jul 21, 2017
c231a73
Provide directed URL as well as resolving
dhh Jul 21, 2017
39f9ef1
Actually we just want them mounted straight
dhh Jul 21, 2017
b6fd579
Fix parens after inline block
dhh Jul 21, 2017
08d84e2
Extract test helper for image blob fixtures
dhh Jul 21, 2017
fa33ec9
Anemic intro
dhh Jul 21, 2017
e9cf92c
Test actual transformations
dhh Jul 21, 2017
f3b092a
Test actual transformation via controller too
dhh Jul 21, 2017
2e9ff80
Quick example of variants
dhh Jul 21, 2017
15cfac1
Merge branch 'master' into variants
dhh Jul 21, 2017
6ac4fec
Mention need for mini_magick with variants
dhh Jul 21, 2017
f0d7ce9
Merge pull request #63 from rails/variants
dhh Jul 21, 2017
b44b0f2
Fix RuboCop offenses and warnings
koic Jul 22, 2017
d040749
Move all controller tests to controller/ dir
dixpac Jul 22, 2017
3acf65f
Merge pull request #67 from dixpac/move_controller_tests
dhh Jul 22, 2017
5fcaa19
Assume Rails is defined
dixpac Jul 22, 2017
470ba69
Don't need to validate transformations actually
dhh Jul 22, 2017
d0a9174
Move storage_services.yml to config for consistency
dhh Jul 22, 2017
5b7c31c
Unused, we can extract from it out-of-repo
dhh Jul 22, 2017
d50679f
Move models and jobs to the app setup
dhh Jul 22, 2017
e5f8872
Move model tests to models directory
dhh Jul 22, 2017
ca0b96d
Fix extension to run test automatically
dhh Jul 22, 2017
e0b89fa
No need for explicit requires any more
dhh Jul 22, 2017
da12346
Nix more needless requires
dhh Jul 22, 2017
5ada431
Even more needless requires
dhh Jul 22, 2017
9e81741
Disk controller must rely on key alone
dhh Jul 23, 2017
8f20624
Switch to a single message verifier
dhh Jul 23, 2017
46da4ee
Switch to simpler signed_id for blob rather than full GlobalID
dhh Jul 23, 2017
c285c68
Provide a BlobsController for stable blob URLs
dhh Jul 23, 2017
347dc16
VerifiedKeyWithExpiration no longer needed
dhh Jul 23, 2017
5889560
Update the README with more explicit expectation setting
dhh Jul 23, 2017
4efbeae
Use parsed_body to auto parse the response as JSON.
kaspth Jul 23, 2017
5963766
Explore regular polymorphic associations rather than record_gid
dhh Jul 9, 2017
212f925
Collapse indeces per Jeremy.
kaspth Jul 23, 2017
a4f36f9
Fix attaching with standard Rails associations.
kaspth Jul 23, 2017
15efa67
Specify verification purposes
dhh Jul 23, 2017
df69899
Merge branch 'master' of github.com:rails/activestorage
dhh Jul 23, 2017
229394b
Merge branch 'master' into explore-polymorphism
dhh Jul 23, 2017
ac26aef
Require mini_magick when it's used
georgeclaghorn Jul 23, 2017
e16739d
Work-around until @response.parsed_body problem is solved
dhh Jul 23, 2017
eb9b019
Return to same level of abstraction
dhh Jul 23, 2017
91d6c6e
Return to same level of abstraction
dhh Jul 23, 2017
c977eef
Work-around until @response.parsed_body problem is solved
dhh Jul 23, 2017
f96abd1
Merge branch 'master' into explore-polymorphism
dhh Jul 23, 2017
68b5d27
Add and test preloading scope
dhh Jul 23, 2017
e16d0c9
No more GlobalID
dhh Jul 23, 2017
2bbfaf0
Demonstrate preloading in example
dhh Jul 23, 2017
54b17a1
Merge pull request #32 from rails/explore-polymorphism
dhh Jul 23, 2017
efa8779
Fix attaching
dhh Jul 23, 2017
f6ba62b
Schema out of date and now obvious
dhh Jul 23, 2017
cb2f7d4
Still need GlobalID for PurgeJob serialization
dhh Jul 23, 2017
5944850
Tell service which content-type to use for the response
dhh Jul 23, 2017
0906893
Don't annotate template class with :nodoc:
georgeclaghorn Jul 23, 2017
2afe2a1
Temporarily skip variant tests pending a fix
georgeclaghorn Jul 23, 2017
d982aee
Skip controller test, too
georgeclaghorn Jul 23, 2017
d8aec0f
Refer to the yielded app
dhh Jul 24, 2017
b203288
Merge branch 'master' of github.com:rails/activestorage
dhh Jul 24, 2017
69922fc
Everything under app/ is eager loaded, don't want that for service
dhh Jul 24, 2017
d0e90b4
Blob/Variant#url -> #service_url to emphasize this URL isn't to be pu…
dhh Jul 24, 2017
52eed68
Verify direct upload checksums
georgeclaghorn Jul 24, 2017
48d0427
Basic documentation for all the models
dhh Jul 24, 2017
d4f014b
Start on docs for lib
dhh Jul 24, 2017
6de1c0b
Merge branch 'master' of github.com:rails/activestorage
dhh Jul 24, 2017
bb34580
Finish basic documentation for controllers
dhh Jul 24, 2017
547737b
Basic documentation for job
dhh Jul 24, 2017
ef92cb0
Follow the same copyright format as the other Rails frameworks
dhh Jul 24, 2017
0e9eb11
Add standard version setup
dhh Jul 24, 2017
20effee
Models are autoloaded per engine standards
dhh Jul 24, 2017
3eb8c89
Fix blob associations
dhh Jul 24, 2017
87cb006
Trivial typo fix
Jul 24, 2017
92536c0
Document the rest of lib
dhh Jul 24, 2017
3a5372d
Flesh out the README a bit more
dhh Jul 24, 2017
6dd82b8
Did that
dhh Jul 24, 2017
1907f46
Deep merge
georgeclaghorn Jul 25, 2017
5492c4e
Add direct upload support to the disk service
georgeclaghorn Jul 26, 2017
6ec6d22
Compare images by selected attributes (size, colorspace)
colorfulfool Jul 26, 2017
0605ed9
Avoid creating unnecessary blobs
georgeclaghorn Jul 26, 2017
7644a58
Check variant image properties directly
georgeclaghorn Jul 26, 2017
c68bdcd
Fix test failure in CI due to platform differences
georgeclaghorn Jul 26, 2017
293db49
Fix broken links in README
Jul 27, 2017
e64e3f1
Introduce the Dummy. (#70)
dixpac Jul 27, 2017
a9091ea
Validate Content-Length
georgeclaghorn Jul 27, 2017
64bbcaf
Use blob service URL methods
georgeclaghorn Jul 27, 2017
dc235c4
Separate show and direct upload tests
georgeclaghorn Jul 27, 2017
6262891
Add JavaScript direct upload support (#81)
javan Jul 27, 2017
a0a23e9
Add JavaScript linting (#82)
javan Jul 28, 2017
b0b072f
Minor constructor signature tweaks
javan Jul 28, 2017
fd43876
Add npm package details
javan Jul 28, 2017
696b8c6
Add a direct_upload: true option to file_field_tag and Form#file_field
dhh Jul 28, 2017
801b4eb
Add Blob#type as a StringInquirer
dhh Jul 28, 2017
1f150e0
Must always return the options even if they werent converted
dhh Jul 28, 2017
a91bb13
Convert type inquiry into root predicates for base types alone instead
dhh Jul 28, 2017
39bfc83
Configure per-service request headers for direct uploads (#83)
javan Jul 30, 2017
9da2c41
activestorage.js 0.1.1
javan Jul 30, 2017
6c68524
Depend on Ruby >=2.2.2 (#85)
dixpac Jul 31, 2017
3f4a721
Azure Storage support (#36)
dixpac Jul 31, 2017
9330d01
Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce3…
rafaelfranca Jul 31, 2017
4687c86
Include default storage configuration
dhh Jul 28, 2017
4b5e042
Use standard Rails layout for gemspec
dhh Jul 31, 2017
253757d
Initialize changelog
dhh Jul 31, 2017
16d0024
Bring activestorage dependencies into the general Gemfile
dhh Jul 31, 2017
17b2137
Require activestorage per default with asset pipeline
dhh Jul 31, 2017
9e50295
No longer used
dhh Jul 31, 2017
54663f5
Resolve gemspec typo
dhh Jul 31, 2017
90a8e06
Use config/storage.yml as part of the skeleton and loading
dhh Jul 31, 2017
d24e72d
Load activestorage by default
dhh Jul 31, 2017
a1a363a
Follow form from actioncable
dhh Jul 31, 2017
9d12683
Fix gitignore to be relative
dhh Jul 31, 2017
e814042
Create the skeleton directories needed and ignore accordingly
dhh Jul 31, 2017
bb69b3e
Directory and config installation now done by app_generator
dhh Jul 31, 2017
5beb87c
Move to new storage.yml location
dhh Jul 31, 2017
ba12811
Move the direct_upload: true convenience option from the activestorag…
dhh Jul 31, 2017
a9cb196
Setup travis to be able to run CI tests against S3
dhh Jul 31, 2017
8b20789
Let ActiveStorage tests pass only for Disk
claudiob Aug 1, 2017
98bb99e
Don't depend on HTTParty
claudiob Aug 1, 2017
7f54123
Merge pull request #30032 from claudiob/remove-httparty
guilleiguaran Aug 1, 2017
d66fade
Merge pull request #30030 from claudiob/only-disk
guilleiguaran Aug 1, 2017
55e6104
Add Azure configuration to Active Storage template
Aug 1, 2017
211b397
Merge pull request #30034 from ffmike/patch-1
guilleiguaran Aug 1, 2017
e98eceb
Rely on top-level files
dhh Aug 1, 2017
087e1e3
We moved to storage.yml
dhh Aug 1, 2017
7ddec68
Add require
dhh Aug 1, 2017
c622e53
Drop README terms no longer relevant
dhh Aug 1, 2017
b807b5b
Cut down on installation advice
dhh Aug 1, 2017
1ea49d6
Follow same format as action_cable
dhh Aug 1, 2017
3e72354
Add the storage.yml file by default
dhh Aug 1, 2017
3d3ec20
Prevent interpolation of ERB elements
dhh Aug 1, 2017
e473946
Merge branch 'master' into active-storage-import
dhh Aug 1, 2017
13882d0
Remove circular dependency
dhh Aug 1, 2017
4f8be04
Fix dummy app for inclusion in Rails
dhh Aug 1, 2017
ff3dad0
Skip if credentials aren't provided
dhh Aug 1, 2017
f927de6
Add Azure to readme
ytbryan Aug 2, 2017
2a8fa2e
Merge pull request #30035 from ytbryan/patch-1
kamipo Aug 2, 2017
b334ac8
Add Azure to the available services list
Aug 2, 2017
4c3c418
Merge pull request #30040 from rbarysas/active-storage-import
kamipo Aug 2, 2017
c697422
Merge branch 'master' into active-storage-import
dhh Aug 2, 2017
815d1ab
Fix `Style/StringLiterals` violations for Active Storage
kamipo Aug 2, 2017
5aeac57
Merge pull request #30046 from kamipo/fix_string_literals_violations_…
rafaelfranca Aug 2, 2017
8aa742f
Add Azure gems to README
Aug 2, 2017
0f2d3fb
Update README.md
Aug 3, 2017
d4f0b10
Use release azure-core gem
Aug 3, 2017
c5ae4e5
Tweak requires
Aug 3, 2017
053e556
Depend on offical azure-core
dixpac Aug 2, 2017
9394451
Merge pull request #30053 from ffmike/patch-2
schneems Aug 3, 2017
624b6c2
Can't initialize a message verifier without a key base
dhh Aug 3, 2017
6b40fed
Generating the app is where the exception is now raised
dhh Aug 3, 2017
9d636c9
Make Rubocop happier about ActiveStorage
claudiob Aug 3, 2017
da44e85
There is no reason to single line methods here
rafaelfranca Aug 3, 2017
425aaab
Active Storage loads AR earlier to extend it so require env later
dhh Aug 3, 2017
a56b2a5
Including new default classes in loading test
dhh Aug 3, 2017
d84a126
Same issue from AR getting loaded earlier
dhh Aug 3, 2017
422ec4c
Make sure Action View doesn't break with Active Storage
rafaelfranca Aug 3, 2017
f1648f6
Refactor convert_direct_upload_option_to_url
rafaelfranca Aug 3, 2017
7a5a84b
Remove duplicated convert_direct_upload_option_to_url
rafaelfranca Aug 3, 2017
5b49e22
Active Storage routes are now part of the default routes
dhh Aug 3, 2017
6a36b6b
Merge branch 'active-storage-import' of github.com:rails/rails into a…
dhh Aug 3, 2017
f601a01
Do not eager load ActiveRecord::Base
rafaelfranca Aug 3, 2017
5bfff1d
We need to require the top file before individual one
rafaelfranca Aug 3, 2017
66e5bf9
Merge pull request #30061 from claudiob/ast-rubocop
rafaelfranca Aug 3, 2017
b76f4e4
Fix all rubocop violations
rafaelfranca Aug 3, 2017
762c7da
Merge pull request #30041 from dixpac/change_azure_core_dependecy
rafaelfranca Aug 3, 2017
77be872
Do not change the entire codebase style only because of active_storage
rafaelfranca Aug 3, 2017
31f6100
Deterministic comparisons please
dhh Aug 4, 2017
2194c27
Convert to strings so array can be sorted deterministically
dhh Aug 4, 2017
787fe90
Include active_storage in all generated application.rb files
dhh Aug 4, 2017
7103771
Do not call isolate_namespace on the application
rafaelfranca Aug 4, 2017
62d3d12
Make sure the test fails if the code chages
rafaelfranca Aug 4, 2017
12d944f
Add Active Storage to README and release (#30065)
claudiob Aug 4, 2017
b9f0eb2
Fix tests for AWS buckets that include a . (#30059)
claudiob Aug 4, 2017
3179f08
Rename Azure to AzureStorage (#30057)
dixpac Aug 4, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ script: 'ci/travis.rb'
env:
global:
- "JRUBY_OPTS='--dev -J-Xmx1024M'"
- "AWS_ACCESS_KEY_ID=AKIAIDIA2E7SSMYGNB7A"
- secure: "XohvFnYff1yf8qlawCujI+CIqHK08KOw34pPprd4QYuG0SJCzBdNN7efBBj5gLX1PI6DwkDLNv51Oi31xPh7yJFuzRAkB0FPdyKM7UyYZ7BMaTqx8LVC89lZJ8VIu19kDP/8sdOm0HN/huOM5kO3jZJFLpi2Tj313TjmzWZFPq0="
matrix:
- "GEM=railties"
- "GEM=ap,ac"
Expand Down
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ group :cable do
gem "sprockets-export", require: false
end

group :storage do
gem "aws-sdk", "~> 2", require: false
gem "google-cloud-storage", "~> 1.3", require: false

# Contains fix to be able to test using StringIO
gem "azure-core", git: "https://github.com/dixpac/azure-ruby-asm-core.git"
gem "azure-storage", require: false

gem "mini_magick"
end

# Add your own local bundler stuff.
local_gemfile = File.expand_path(".Gemfile", __dir__)
instance_eval File.read local_gemfile if File.exist? local_gemfile
Expand Down
81 changes: 81 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ GIT
queue_classic (3.2.0.RC1)
pg (>= 0.17, < 0.20)

GIT
remote: https://github.com/dixpac/azure-ruby-asm-core.git
revision: 4403389747f44a94b73e7a7522d1ea11f8b1a266
specs:
azure-core (0.1.8)
faraday (~> 0.9)
faraday_middleware (~> 0.10)
nokogiri (~> 1.7)

GIT
remote: https://github.com/erikhuda/thor.git
revision: df5ba2b653a28087b3617d6c082b00866b0c0d6c
Expand Down Expand Up @@ -82,6 +91,9 @@ PATH
activemodel (= 5.2.0.alpha)
activesupport (= 5.2.0.alpha)
arel (= 9.0.0.alpha)
activestorage (5.2.0.alpha)
actionpack (= 5.2.0.alpha)
activerecord (= 5.2.0.alpha)
activesupport (5.2.0.alpha)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
Expand All @@ -95,6 +107,7 @@ PATH
activejob (= 5.2.0.alpha)
activemodel (= 5.2.0.alpha)
activerecord (= 5.2.0.alpha)
activestorage (= 5.2.0.alpha)
activesupport (= 5.2.0.alpha)
bundler (>= 1.3.0)
railties (= 5.2.0.alpha)
Expand All @@ -113,6 +126,19 @@ GEM
public_suffix (~> 2.0, >= 2.0.2)
amq-protocol (2.2.0)
ast (2.3.0)
aws-sdk (2.10.19)
aws-sdk-resources (= 2.10.19)
aws-sdk-core (2.10.19)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.10.19)
aws-sdk-core (= 2.10.19)
aws-sigv4 (1.0.1)
azure-storage (0.11.4.preview)
azure-core (~> 0.1)
faraday (~> 0.9)
faraday_middleware (~> 0.10)
nokogiri (~> 1.6)
backburner (1.4.1)
beaneater (~> 1.0)
concurrent-ruby (~> 1.0.1)
Expand Down Expand Up @@ -168,11 +194,14 @@ GEM
daemons (1.2.4)
dalli (2.7.6)
dante (0.2.0)
declarative (0.0.9)
declarative-option (0.1.0)
delayed_job (4.1.3)
activesupport (>= 3.0, < 5.2)
delayed_job_active_record (4.1.2)
activerecord (>= 3.0, < 5.2)
delayed_job (>= 3.0, < 5)
digest-crc (0.4.1)
em-hiredis (0.3.1)
eventmachine (~> 1.0)
hiredis (~> 0.6.0)
Expand All @@ -195,6 +224,8 @@ GEM
execjs (2.7.0)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.12.0)
faraday (>= 0.7.4, < 1.0)
faye (1.2.4)
cookiejar (>= 0.3.0)
em-http-request (>= 0.3.0)
Expand All @@ -211,14 +242,41 @@ GEM
ffi (1.9.18-x86-mingw32)
globalid (0.4.0)
activesupport (>= 4.2.0)
google-api-client (0.13.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.5)
httpclient (>= 2.8.1, < 3.0)
mime-types (~> 3.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
google-cloud-core (1.0.0)
google-cloud-env (~> 1.0)
googleauth (~> 0.5.1)
google-cloud-env (1.0.1)
faraday (~> 0.11)
google-cloud-storage (1.3.0)
digest-crc (~> 0.4)
google-api-client (~> 0.13.0)
google-cloud-core (~> 1.0)
googleauth (0.5.3)
faraday (~> 0.12)
jwt (~> 1.4)
logging (~> 2.0)
memoist (~> 0.12)
multi_json (~> 1.11)
os (~> 0.9)
signet (~> 0.7)
hiredis (0.6.1)
http_parser.rb (0.6.0)
httpclient (2.8.3)
i18n (0.8.6)
jmespath (1.3.1)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.1.0)
jwt (1.5.6)
kindlerb (1.2.0)
mustache
nokogiri
Expand All @@ -227,15 +285,21 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.6)
mime-types (>= 1.16, < 4)
memoist (0.16.0)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.8.0)
mini_portile2 (2.2.0)
minitest (5.10.2)
minitest-bisect (1.4.0)
Expand Down Expand Up @@ -263,6 +327,7 @@ GEM
mini_portile2 (~> 2.2.0)
nokogiri (1.8.0-x86-mingw32)
mini_portile2 (~> 2.2.0)
os (0.9.6)
parallel (1.11.2)
parser (2.4.0.0)
ast (~> 2.2)
Expand Down Expand Up @@ -303,6 +368,10 @@ GEM
redis (3.3.3)
redis-namespace (1.5.3)
redis (~> 3.0, >= 3.0.4)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
resque (1.27.4)
mono_logger (~> 1.0)
multi_json (~> 1.0)
Expand All @@ -314,6 +383,7 @@ GEM
redis (~> 3.3)
resque (~> 1.26)
rufus-scheduler (~> 3.2)
retriable (3.1.1)
rubocop (0.49.1)
parallel (~> 1.10)
parser (>= 2.3.3.1, < 3.0)
Expand Down Expand Up @@ -345,6 +415,11 @@ GEM
rack-protection (>= 1.5.0)
redis (~> 3.3, >= 3.3.3)
sigdump (0.2.4)
signet (0.7.3)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (~> 1.5)
multi_json (~> 1.10)
simple_uuid (0.4.0)
sinatra (2.0.0)
mustermann (~> 1.0)
Expand Down Expand Up @@ -384,6 +459,7 @@ GEM
thread_safe (~> 0.1)
tzinfo-data (1.2017.2)
tzinfo (>= 1.0.0)
uber (0.1.0)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.3.0)
Expand Down Expand Up @@ -411,6 +487,9 @@ DEPENDENCIES
activerecord-jdbcpostgresql-adapter (>= 1.3.0)
activerecord-jdbcsqlite3-adapter (>= 1.3.0)
arel!
aws-sdk (~> 2)
azure-core!
azure-storage
backburner
bcrypt (~> 3.1.11)
benchmark-ips
Expand All @@ -425,12 +504,14 @@ DEPENDENCIES
delayed_job_active_record
em-hiredis
erubis (~> 2.7.0)
google-cloud-storage (~> 1.3)
hiredis
jquery-rails
json (>= 2.0.0)
kindlerb (~> 1.2.0)
libxml-ruby
listen (>= 3.0.5, < 3.2)
mini_magick
minitest-bisect
mocha (~> 0.14)
mysql2 (>= 0.4.4)
Expand Down
7 changes: 6 additions & 1 deletion actionview/lib/action_view/helpers/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require_relative "../record_identifier"
require "active_support/core_ext/module/attribute_accessors"
require "active_support/core_ext/hash/slice"
require "active_support/core_ext/hash/compact"
require "active_support/core_ext/string/output_safety"
require "active_support/core_ext/string/inflections"

Expand Down Expand Up @@ -1193,7 +1194,7 @@ def hidden_field(object_name, method, options = {})
# file_field(:attachment, :file, class: 'file_input')
# # => <input type="file" id="attachment_file" name="attachment[file]" class="file_input" />
def file_field(object_name, method, options = {})
Tags::FileField.new(object_name, method, self, options).render
Tags::FileField.new(object_name, method, self, convert_direct_upload_option_to_url(options)).render
end

# Returns a textarea opening and closing tag set tailored for accessing a specified attribute (identified by +method+)
Expand Down Expand Up @@ -2316,6 +2317,10 @@ def convert_to_legacy_options(options)
options[:include_id] = !options.delete(:skip_id)
end
end

def convert_direct_upload_option_to_url(options)
options.merge('data-direct-upload-url': options.delete(:direct_upload) ? rails_direct_uploads_url : nil).compact
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file needs to require "active_support/core_ext/hash/compact" now.

end
end
end

Expand Down
6 changes: 5 additions & 1 deletion actionview/lib/action_view/helpers/form_tag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def hidden_field_tag(name, value = nil, options = {})
# file_field_tag 'file', accept: 'text/html', class: 'upload', value: 'index.html'
# # => <input accept="text/html" class="upload" id="file" name="file" type="file" value="index.html" />
def file_field_tag(name, options = {})
text_field_tag(name, nil, options.merge(type: :file))
text_field_tag(name, nil, convert_direct_upload_option_to_url(options.merge(type: :file)))
end

# Creates a password field, a masked text field that will hide the users input behind a mask character.
Expand Down Expand Up @@ -904,6 +904,10 @@ def set_default_disable_with(value, tag_options)

tag_options.delete("data-disable-with")
end

def convert_direct_upload_option_to_url(options)
options.merge('data-direct-upload-url': options.delete(:direct_upload) ? rails_direct_uploads_url : nil).compact
end
end
end
end
5 changes: 5 additions & 0 deletions activestorage/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
["env", { "modules": false } ]
]
}
7 changes: 7 additions & 0 deletions activestorage/.codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
engines:
rubocop:
enabled: true

ratings:
paths:
- "**.rb"
19 changes: 19 additions & 0 deletions activestorage/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "eslint:recommended",
"rules": {
"semi": ["error", "never"],
"quotes": ["error", "double"],
"no-unused-vars": ["error", { "vars": "all", "args": "none" }]
},
"plugins": [
"import"
],
"env": {
"browser": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
}
}
6 changes: 6 additions & 0 deletions activestorage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.byebug_history
node_modules
test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
test/dummy/tmp/
3 changes: 3 additions & 0 deletions activestorage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Added to Rails.

*DHH*
20 changes: 20 additions & 0 deletions activestorage/MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2017 David Heinemeier Hansson, Basecamp

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading