Skip to content

Commit

Permalink
Using puma as dependency and correct image controller
Browse files Browse the repository at this point in the history
  • Loading branch information
alaxalves committed Aug 16, 2019
1 parent 3b2274a commit ac8e40c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ group :dependencies do
gem 'bootsnap', '~> 1.4.4'
gem 'turbolinks', '~> 5'
gem 'mini_magick', '~> 4.8'
gem 'puma', '~> 4.1.0'

# if you use amazon s3 for warpable image storage
gem 'aws-sdk', '~> 1.5.7'
Expand All @@ -38,14 +39,14 @@ group :dependencies do
gem 'rdiscount', '2.2.0.1'

# Process manager for applications with multiple components
gem "foreman", "~> 0.85.0"
gem 'foreman', '~> 0.85.0'

# asset pipelining
gem 'bootstrap-sass'
gem 'sassc-rails'
gem 'jquery-rails'
gem 'sprockets', '3.7.2'
gem "sprockets-rails"
gem 'sprockets-rails'
gem 'sass', require: 'sass'
gem 'autoprefixer-rails', '~> 9.5.1.1'
gem 'uglifier', '~> 4.1.20'
Expand All @@ -66,12 +67,10 @@ end

group :development, :test do
gem 'capybara'
gem 'puma'
gem 'selenium-webdriver'
gem 'byebug', '~> 11.0.1', platforms: [:mri, :mingw, :x64_mingw]
gem 'faker', '~> 2.1.2'
gem 'pry-rails', '~> 0.3.9'
gem 'puma'
gem 'action-cable-testing'
end

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ DEPENDENCIES
passenger
popper_js (~> 1.11, >= 1.11.1)
pry-rails (~> 0.3.9)
puma
puma (~> 4.1.0)
rails (~> 5.2.3)
rails-controller-testing
rails-perftest
Expand Down
2 changes: 1 addition & 1 deletion app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def find_verified_user
User.find(cookies.signed["user_id"])
rescue ActiveRecord::RecordNotFound
reject_unauthorized_connection
end
end
end
end
6 changes: 2 additions & 4 deletions app/controllers/images_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'open-uri'
class ImagesController < ApplicationController
rescue_from Errno::ENOENT, Errno::ETIMEDOUT,
OpenURI::HTTPError, Timeout::Error,
with: :url_upload_not_found
OpenURI::HTTPError, Timeout::Error,
with: :url_upload_not_found
protect_from_forgery except: %i(update delete)
# Convert model to json without including root name. Eg. 'warpable'
ActiveRecord::Base.include_root_in_json = false
Expand Down Expand Up @@ -92,8 +92,6 @@ def update
@warpable.locked = params[:locked]
@warpable.cm_per_pixel = @warpable.get_cm_per_pixel
@warpable.save
data = @warpable.map.fetch_map_data # Get the updated warpable data
render json: data
render html: 'success'
else
render plain: 'You must be logged in to update the image, unless the map is anonymous.'
Expand Down
1 change: 0 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ bump_database(){
bundle exec rails db:schema:load || bundle exec rails db:migrate
}

bundle update
bundle check || bundle install

if bundle exec rails db:exists; then
Expand Down

0 comments on commit ac8e40c

Please sign in to comment.