aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-06 17:25:40 +0200
committerGitHub <noreply@github.com>2017-07-06 17:25:40 +0200
commit8fb2e96724f8b4dc2da15312f5769578cb0f3372 (patch)
treef8b07f205eebbe85eea6fddaac793eaf3c2b3c9f
parent4f30570bd6cd122a7e7839eed4fc9531db600496 (diff)
downloadrails-8fb2e96724f8b4dc2da15312f5769578cb0f3372.tar.gz
rails-8fb2e96724f8b4dc2da15312f5769578cb0f3372.tar.bz2
rails-8fb2e96724f8b4dc2da15312f5769578cb0f3372.zip
Describe some of the design differences in AS
-rw-r--r--README.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/README.md b/README.md
index ab01df471e..ecfc2ed170 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,12 @@ Active Storage makes it simple to upload and reference files in cloud services,
and attach those files to Active Records. It also provides a disk service for testing or local deployments, but the
focus is on cloud storage.
+## Compared to other storage solutions
+
+A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in `Blob` and `Attachment` models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses GlobalID to provide polymorphic associations via the join model of `Attachment`, which then connects to the actual `Blob`.
+
+These `Blob` models are intended to be immutable in spirit. One file, one blob. You can associate the same blob with multiple application models as well. And if you want to do transformations of a given `Blob`, the idea is that you'll simply create a new one, rather than attempt to mutate the existing (though of course you can delete that later if you don't need it).
+
## Examples
One attachment: