Skip to content

Commit

Permalink
Autofixing rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
alaxalves committed Jul 2, 2019
1 parent b40bebd commit d5ed24a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions app/controllers/annotations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def update
return if @annotation.user_id.nil? || current_user.can_edit?(@annotation)

Annotation.update(@annotation.id,
coordinates: geojson[:geometry][:coordinates],
text: geojson[:properties][:textContent],
style: geojson[:properties][:style])
coordinates: geojson[:geometry][:coordinates],
text: geojson[:properties][:textContent],
style: geojson[:properties][:style])
render file: 'annotations/update.json.erb',
content_type: 'application/json'
end
Expand Down
4 changes: 2 additions & 2 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
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ def sort_direction

def user_params
params.require(:user).permit(:login, :email, :name,
:password, :password_confirmation)
:password, :password_confirmation)
end
end
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def errors_for(object, message = nil)
# see https://github.com/rails/jquery-ujs/wiki/Manual-installing-and-Rails-2
def csrf_meta_tags
if protect_against_forgery?
out = %(<meta name="csrf-param" content="%s"/>\n) # rubocop:disable Style/FormatStringToken
out << %(<meta name="csrf-token" content="%s"/>) # rubocop:disable Style/FormatStringToken
out = %(<meta name="csrf-param" content="%s"/>\n)
out << %(<meta name="csrf-token" content="%s"/>)
format(out, Rack::Utils.escape_html(request_forgery_protection_token), Rack::Utils.escape_html(form_authenticity_token))
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ def self.histogram_cm_per_pixel_in_tens

def self.export_count
Export.where('status != "failed" AND status != "complete" AND status != "none" AND updated_at > ?',
(DateTime.now - 24.hours).to_s(:db)).count
(DateTime.now - 24.hours).to_s(:db)).count
end

# all exports currently running
def self.exporting
Export.where('status != "failed" AND status != "complete" AND status != "none" AND updated_at > ?',
(DateTime.now - 24.hours).to_s(:db))
(DateTime.now - 24.hours).to_s(:db))
end
end
18 changes: 9 additions & 9 deletions app/models/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def nearby_maps(dist)
return [] if lat.to_f == 0.0 || lon.to_f == 0.0

Map.where('id != ? AND lat > ? AND lat < ? AND lon > ? AND lon < ?',
id, lat - dist, lat + dist, lon - dist, lon + dist)
id, lat - dist, lat + dist, lon - dist, lon + dist)
.limit(10)
end

Expand Down Expand Up @@ -234,14 +234,14 @@ def run_export(user, resolution)
new_export = Export.new(map_id: id) unless export

Exporter.run_export(user,
resolution,
export || new_export,
id,
slug,
Rails.root.to_s,
average_scale,
placed_warpables,
key)
resolution,
export || new_export,
id,
slug,
Rails.root.to_s,
average_scale,
placed_warpables,
key)
end

def after_create
Expand Down
12 changes: 6 additions & 6 deletions app/models/warpable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class Warpable < ActiveRecord::Base
# Paperclip; config and production/development specific configs
# in /config/initializers/paperclip.rb
has_attached_file :image,
s3_protocol: 'https',
styles: {
medium: "500x375",
small: "240x180",
thumb: "100x100>"
}
s3_protocol: 'https',
styles: {
medium: "500x375",
small: "240x180",
thumb: "100x100>"
}

validates_attachment_content_type :image, content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif"]

Expand Down

0 comments on commit d5ed24a

Please sign in to comment.