Merge pull request #1660 from consul/fix/rubocop_issues

Fix some Rubocop issues
This commit is contained in:
Raimond Garcia
2017-06-20 21:49:59 +02:00
committed by GitHub
21 changed files with 108 additions and 153 deletions

View File

@@ -17,7 +17,9 @@ class Notification < ActiveRecord::Base
end
def self.add(user_id, notifiable)
if notification = Notification.find_by(user_id: user_id, notifiable: notifiable)
notification = Notification.find_by(user_id: user_id, notifiable: notifiable)
if notification.present?
Notification.increment_counter(:counter, notification.id)
else
Notification.create!(user_id: user_id, notifiable: notifiable)
@@ -50,4 +52,4 @@ class Notification < ActiveRecord::Base
notifiable.is_a?(ProposalNotification) ? notifiable.proposal : notifiable
end
end
end

View File

@@ -62,7 +62,7 @@ class Officing::Residence
document_type: document_type).first
end
def residence_in_madrid
def residence_in_madrid
return if errors.any?
unless residency_valid?

View File

@@ -21,9 +21,8 @@ class SiteCustomization::Image < ActiveRecord::Base
def self.image_path_for(filename)
image_name = filename.split(".").first
if i = find_by(name: image_name)
i.image.exists? ? i.image.url : nil
end
imageable = find_by(name: image_name)
imageable.present? && imageable.image.exists? ? imageable.image.url : nil
end
def required_width