Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmartin committed Jan 12, 2023
2 parents 5359d7f + 913892a commit e6b35db
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 30 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/artists_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ def set_artist
end

def artist_params
params.require(:artist).permit(:short_description, :search, :website, :name, :bandcamp, :facebook, :soundcloud, :spotify, :youtube, :itunes, :twitter, image: [:content_type, :filename, :data])
params.require(:artist).permit(:short_description, :search, :website, :name, :bandcamp, :facebook, :soundcloud, :spotify, :youtube, :itunes, :twitter, :instagram, image: [:content_type, :filename, :data])
end
end
4 changes: 2 additions & 2 deletions app/controllers/api/options_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ def update
private

def set_option
@option = Option.find_by(name: "global")
@option = Option.find_by(name: "releaseWaveGlobalOptions")
end

def prepare_option
@option = Option.find_or_create_by!(name: "global")
@option = Option.find_or_create_by!(name: "releaseWaveGlobalOptions")
@option.save!
end

Expand Down
24 changes: 13 additions & 11 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

config.active_storage.service = :amazon

config.paperclip_defaults = {
storage: :s3,
s3_host_name: ENV.fetch('S3_HOST_NAME'),
s3_host_name: ENV.fetch("S3_HOST_NAME"),
preserve_files: true,
s3_credentials: {
bucket: ENV.fetch('S3_BUCKET'),
access_key_id: ENV.fetch('S3_ACCESS_KEY_ID'),
secret_access_key: ENV.fetch('S3_SECRET_ACCESS_KEY'),
s3_region: ENV.fetch('S3_REGION'),
}
bucket: ENV.fetch("S3_BUCKET"),
access_key_id: ENV.fetch("S3_ACCESS_KEY_ID"),
secret_access_key: ENV.fetch("S3_SECRET_ACCESS_KEY"),
s3_region: ENV.fetch("S3_REGION"),
},
}

# Code is not reloaded between requests.
Expand All @@ -23,7 +25,7 @@
config.eager_load = true

# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
Expand All @@ -33,7 +35,7 @@

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Expand Down Expand Up @@ -64,7 +66,7 @@
config.log_level = :debug

# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]

# Use a different cache store in production.
# config.cache_store = :mem_cache_store
Expand Down Expand Up @@ -93,9 +95,9 @@
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')

if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.logger = ActiveSupport::TaggedLogging.new(logger)
end

# Do not dump schema after migrations.
Expand Down
9 changes: 4 additions & 5 deletions config/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ local:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>


amazon:
service: S3
access_key_id: <%= ENV['S3_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['S3_SECRET_ACCESS_KEY'] %>
region: <%= ENV['S3_REGION'] %>
bucket: <%= ENV['S3_BUCKET'] %>
access_key_id: <%= ENV.fetch('S3_ACCESS_KEY_ID') %>
secret_access_key: <%= ENV.fetch('S3_SECRET_ACCESS_KEY') %>
region: <%= ENV.fetch('S3_REGION') %>
bucket: <%= ENV.fetch('S3_BUCKET') %>

9 changes: 6 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@

create_table "articles", force: :cascade do |t|
t.string "title"
t.string "content"
t.string "type"
t.text "content"
t.bigint "artist_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "slug"
t.index ["artist_id"], name: "index_articles_on_artist_id"
t.index ["slug"], name: "index_articles_on_slug", unique: true
end

Expand All @@ -62,7 +65,7 @@
t.datetime "updated_at", null: false
t.string "image_file_name"
t.string "image_content_type"
t.bigint "image_file_size"
t.integer "image_file_size"
t.datetime "image_updated_at"
t.string "slug"
t.string "website"
Expand Down Expand Up @@ -135,7 +138,7 @@
t.datetime "updated_at", null: false
t.string "image_file_name"
t.string "image_content_type"
t.bigint "image_file_size"
t.integer "image_file_size"
t.datetime "image_updated_at"
t.string "slug"
t.string "buy"
Expand Down
15 changes: 7 additions & 8 deletions lib/tasks/seeds.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
namespace :db do
desc "seed option"
task seedOption: [:environment] do
puts "seeding options"
@option = Option.find_or_create_by!(name: "global")
@option = Option.find_or_create_by!(name: "releaseWaveGlobalOptions")
if @option.data.nil?
@data = "{
featured_date_before: 25,
featured_date_after: 25,
upcoming_date_before: 25,
upcoming_date_after: 25
}"
@data = '{
"featured_date_before": 30,
"featured_date_after": 30,
"upcoming_date_before": 21,
"upcoming_date_after": 21
}'
@option.update!(data: @data)
puts "updated option with defaults: #{@data}"
else
Expand Down

0 comments on commit e6b35db

Please sign in to comment.