diff --git a/app/assets/javascripts/darkswarm/controllers/group_enterprise_node_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/group_enterprise_node_controller.js.coffee index 31c2354a53..376320e458 100644 --- a/app/assets/javascripts/darkswarm/controllers/group_enterprise_node_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/group_enterprise_node_controller.js.coffee @@ -2,7 +2,7 @@ Darkswarm.controller "GroupEnterpriseNodeCtrl", ($scope, CurrentHub) -> $scope.active = false - $scope.toggle = () -> + $scope.toggle = -> $scope.active = !$scope.active $scope.open = -> diff --git a/app/assets/javascripts/darkswarm/controllers/tabs_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/tabs_controller.js.coffee index 74ce167580..fad13164ff 100644 --- a/app/assets/javascripts/darkswarm/controllers/tabs_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/tabs_controller.js.coffee @@ -4,7 +4,7 @@ Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location) -> $location.hash() == path # Select tab by setting the url hash path. - $scope.select= (path)-> + $scope.select = (path)-> $location.hash path # Toggle tab selected status by setting the url hash path. diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index 6ca71a7b78..c5de5c1ca0 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -1,7 +1,7 @@ module GroupsHelper def link_to_service(baseurl, name, html_options = {}) - if name.blank? then return end + return if name.blank? html_options = html_options.merge target: '_blank' link_to ext_url(baseurl, name), html_options do yield @@ -9,10 +9,10 @@ module GroupsHelper end def ext_url(prefix, url) - if (url =~ /^https?:\/\//i) - return url + if url =~ /^https?:\/\//i + url else - return prefix + url + prefix + url end end diff --git a/app/models/enterprise_group.rb b/app/models/enterprise_group.rb index 60c9162a77..582518e208 100644 --- a/app/models/enterprise_group.rb +++ b/app/models/enterprise_group.rb @@ -43,7 +43,7 @@ class EnterpriseGroup < ActiveRecord::Base if user.has_spree_role?('admin') scoped else - where('owner_id = ?', user.id); + where('owner_id = ?', user.id) end } @@ -52,9 +52,7 @@ class EnterpriseGroup < ActiveRecord::Base end def set_undefined_address_fields - if !address.present? - return - end + return unless address.present? address.phone.present? || address.phone = 'undefined' address.address1.present? || address.address1 = 'undefined' address.city.present? || address.city = 'undefined' diff --git a/app/views/admin/enterprise_groups/_form.html.haml b/app/views/admin/enterprise_groups/_form.html.haml index 9ebf6db147..c72c566e46 100644 --- a/app/views/admin/enterprise_groups/_form.html.haml +++ b/app/views/admin/enterprise_groups/_form.html.haml @@ -1,4 +1,4 @@ -= render :partial => 'spree/shared/error_messages', :locals => { :target => @enterprise } += render 'spree/shared/error_messages', target: @enterprise = form_for [main_app, :admin, @enterprise_group] do |f| .row{ ng: {app: 'admin.enterprise_groups', controller: 'enterpriseGroupCtrl'} } @@ -7,5 +7,5 @@ = render 'admin/shared/side_menu' .one.column   .eleven.columns.omega.fullwidth_inputs - = render :partial => 'inputs', :locals => { :f => f } - = render partial: "spree/admin/shared/#{action}_resource_links" + = render 'inputs', f: f + = render "spree/admin/shared/#{action}_resource_links" diff --git a/db/migrate/20150115050936_add_address_instances_to_existing_enterprise_groups.rb b/db/migrate/20150115050936_add_address_instances_to_existing_enterprise_groups.rb index 2978d286dc..0800948126 100644 --- a/db/migrate/20150115050936_add_address_instances_to_existing_enterprise_groups.rb +++ b/db/migrate/20150115050936_add_address_instances_to_existing_enterprise_groups.rb @@ -3,9 +3,7 @@ class AddAddressInstancesToExistingEnterpriseGroups < ActiveRecord::Migration country = Spree::Country.find_by_name(ENV['DEFAULT_COUNTRY']) state = country.states.first EnterpriseGroup.all.each do |g| - if g.address.present? then - next - end + next if g.address.present? address = Spree::Address.new(firstname: 'unused', lastname: 'unused', address1: 'undefined', city: 'undefined', zipcode: 'undefined', state: state, country: country, phone: 'undefined') g.address = address g.save