Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel O'Connor committed Jan 20, 2018
1 parent d2a88da commit 705ea17
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controllers/entities/contacts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ def create
else
if params[:account]
@account = if params[:account][:id].blank?
if request.referer =~ /\/accounts\/(\d+)\z/
if request.referer =~ /\/accounts\/(\d+)\z/
Account.find(Regexp.last_match[1]) # related account
else
Account.new(user: current_user)
end
end
else
Account.find(params[:account][:id])
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/entities/leads_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ def create
else
if params[:account]
@account = if params[:account][:id].blank?
if request.referer =~ /\/accounts\/(\d+)\z/
if request.referer =~ /\/accounts\/(\d+)\z/
Account.find(Regexp.last_match[1]) # related account
else
Account.new(user: current_user)
end
end
else
Account.find(params[:account][:id])
end
Expand Down
6 changes: 4 additions & 2 deletions db/migrate/20180120082635_lead_belongs_to_account.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

class LeadBelongsToAccount < ActiveRecord::Migration[5.1]
def change
add_column :leads, :account_id, :int
add_column :leads, :account_id, :int

add_index :leads, :account_id
add_index :leads, :account_id
end
end

0 comments on commit 705ea17

Please sign in to comment.