Commit 9fc82ebe authored by marcheing's avatar marcheing

Use AWSSettings hash for s3_credentials on Content

parent 3920f3e0
Pipeline #3603955 passed with stage
in 8 minutes and 54 seconds
class Content < ApplicationRecord
has_attached_file :video,
storage: :s3,
s3_credentials: { |a| a.instance.s3_credentials },
s3_credentials: AWSSettings.to_h,
s3_region: AWSSettings.aws_region
validates_attachment :video, presence: true
validates_attachment_content_type :video, content_type: /\Avideo\/.*\Z/
......@@ -9,9 +9,5 @@ class Content < ApplicationRecord
validates :terms_of_service, acceptance: true
validates :title, :user_id, :soundtrack, :director, presence: true
def s3_credentials
{ bucket: AWSSettings.bucket, access_key_id: AWSSettings.access_key_id, secret_access_key: AWSSettings.secret_access_key }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment