aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_storage/service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/active_storage/service.rb')
-rw-r--r--lib/active_storage/service.rb31
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/active_storage/service.rb b/lib/active_storage/service.rb
index 9aab654d80..f15958fda9 100644
--- a/lib/active_storage/service.rb
+++ b/lib/active_storage/service.rb
@@ -1,4 +1,34 @@
# Abstract class serving as an interface for concrete services.
+#
+# The available services are:
+#
+# * +Disk+, to manage attachments saved directly on the hard drive.
+# * +GCS+, to manage attachments through Google Cloud Storage.
+# * +S3+, to manage attachments through Amazon S3.
+# * +Mirror+, to be able to use several services to manage attachments.
+#
+# Inside a Rails application, you can set-up your services through the
+# generated <tt>config/storage_services.yml</tt> file and reference one
+# of the aforementioned constant under the +service+ key. For example:
+#
+# local:
+# service: Disk
+# root: <%= Rails.root.join("storage") %>
+#
+# You can checkout the service's constructor to know which keys are required.
+#
+# Then, in your application's configuration, you can specify the service to
+# use like this:
+#
+# config.active_storage.service = :local
+#
+# If you are using Active Storage outside of a Ruby on Rails application, you
+# can configure the service to use like this:
+#
+# ActiveStorage::Blob.service = ActiveStorage::Service.configure(
+# :Disk,
+# root: Pathname("/foo/bar/storage")
+# )
class ActiveStorage::Service
class ActiveStorage::IntegrityError < StandardError; end
@@ -11,7 +41,6 @@ class ActiveStorage::Service
end
end
-
def upload(key, io, checksum: nil)
raise NotImplementedError
end