Skip to content

Commit

Permalink
Rubocop: Hash syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Jan 10, 2017
1 parent 83ad945 commit e3ee3bf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
12 changes: 0 additions & 12 deletions .rubocop_todo.yml
Expand Up @@ -419,18 +419,6 @@ Style/GlobalVars:
Style/GuardClause:
Enabled: false

# Offense count: 11
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/helpers/accounts_helper.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/opportunities_helper.rb'
- 'lib/fat_free_crm/engine.rb'

# Offense count: 2
Style/IdenticalConditionalBranches:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -272,7 +272,7 @@ def cors_preflight_check
headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Token'
headers['Access-Control-Max-Age'] = '1728000'

render :text => '', :content_type => 'text/plain'
render text: '', content_type: 'text/plain'
end
end
end
4 changes: 2 additions & 2 deletions app/helpers/accounts_helper.rb
Expand Up @@ -28,8 +28,8 @@ def account_select(options = {})
options[:selected] = (@account && @account.id) || 0
accounts = ([@account] + Account.my.order(:name).limit(25)).compact.uniq
collection_select :account, :id, accounts, :id, :name, options,
:"data-placeholder" => t(:select_an_account),
:"data-url" => auto_complete_accounts_path(format: 'json'),
"data-placeholder": t(:select_an_account),
"data-url": auto_complete_accounts_path(format: 'json'),
style: "width:330px; display:none;",
class: 'ajax_chosen'
end
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Expand Up @@ -260,7 +260,7 @@ def web_presence_icons(person)
else
url = "http://" << url unless url.match(/^https?:\/\//)
end
link_to(image_tag("#{site}.gif", size: "15x15"), h(url), :"data-popup" => true, title: t(:open_in_window, h(url)))
link_to(image_tag("#{site}.gif", size: "15x15"), h(url), "data-popup": true, title: t(:open_in_window, h(url)))
end
end.compact.join("\n").html_safe
end
Expand Down Expand Up @@ -482,7 +482,7 @@ def view_buttons
end
lis << content_tag(:li) do
url = (action == "index") ? send("redraw_#{controller}_path") : send("#{controller.singularize}_path")
link_to('#', title: t(view.name, default: h(view.title)), :"data-view" => h(view.name), :"data-url" => h(url), :"data-context" => action, class: classes) do
link_to('#', title: t(view.name, default: h(view.title)), "data-view": h(view.name), "data-url": h(url), "data-context": action, class: classes) do
icon = view.icon || 'fa-bars'
content_tag(:i, nil, class: "fa #{h icon}")
end
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/opportunities_helper.rb
Expand Up @@ -38,8 +38,8 @@ def opportunity_campaign_select(options = {})
selected_campaign = Campaign.find_by_id(options[:selected])
campaigns = ([selected_campaign] + Campaign.my.order(:name).limit(25)).compact.uniq
collection_select :opportunity, :campaign_id, campaigns, :id, :name, options,
:"data-placeholder" => t(:select_a_campaign),
:"data-url" => auto_complete_campaigns_path(format: 'json'),
"data-placeholder": t(:select_a_campaign),
"data-url": auto_complete_campaigns_path(format: 'json'),
style: "width:330px; display:none;",
class: 'ajax_chosen'
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fat_free_crm/engine.rb
Expand Up @@ -11,7 +11,7 @@ class Engine < ::Rails::Engine
config.active_record.observers = [:lead_observer, :opportunity_observer,
:task_observer, :entity_observer]

initializer "model_core.factories", :after => "factory_girl.set_factory_paths" do
initializer "model_core.factories", after: "factory_girl.set_factory_paths" do
FactoryGirl.definition_file_paths << File.expand_path('../../../spec/factories', __FILE__) if defined?(FactoryGirl)
end

Expand Down

0 comments on commit e3ee3bf

Please sign in to comment.