Skip to content

Commit

Permalink
Manually fix remaining linting errors
Browse files Browse the repository at this point in the history
We should avoid making the Gemfile conditional on environment
variables. This can always be done locally, on the relatively
few occassions it's actually needed.
  • Loading branch information
Ben Thorner committed May 27, 2020
1 parent 9cd1136 commit 2d6b614
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 18 deletions.
7 changes: 1 addition & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
ruby File.read(".ruby-version").strip
source "https://rubygems.org"

if ENV["API_DEV"]
gem "gds-api-adapters", path: "../gds-api-adapters"
else
gem "gds-api-adapters", "~> 63.6.0"
end

gem "addressable", "~> 2.7.0"
gem "dalli"
gem "gds-api-adapters", "~> 63.6.0"
gem "gds-sso", "~> 14.3"
gem "google-api-client", "~> 0.39.4"
gem "googleauth", "~> 0.12.0"
Expand Down
5 changes: 1 addition & 4 deletions app/models/local_authority.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ def provided_service_links
end

def update_broken_link_count
update_attribute(
:broken_link_count,
provided_service_links.broken_or_missing.count,
)
update(broken_link_count: provided_service_links.broken_or_missing.count)
end

def to_param
Expand Down
5 changes: 1 addition & 4 deletions app/models/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ def tiers
end

def update_broken_link_count
update_attribute(
:broken_link_count,
Link.for_service(self).broken_or_missing.count,
)
update(broken_link_count: Link.for_service(self).broken_or_missing.count)
end

def valid_tier?(tier)
Expand Down
1 change: 0 additions & 1 deletion db/migrate/20200415103445_enable_service1113.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def up

if service_interaction
service_interaction.update!(live: true)
puts "Successfully enabled service 1113"
else
raise "Service 1113 has not been imported from ESD"
end
Expand Down
1 change: 0 additions & 1 deletion db/migrate/20200501124957_enable_service_1287.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def up

if service_interaction
service_interaction.update!(live: true)
puts "Successfully enabled service 1287"
else
raise "Service 1287 has not been imported from ESD"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/local-links-manager/import/services_tier_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def checked_services
def check_for_missing_services(summariser)
missing = []
Service.enabled.each do |service|
next unless checked_services.exclude?(service)
next if checked_services.include?(service)

summariser.increment_missing_record_count
missing << service
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

factory :link_for_disabled_service, parent: :link do
after(:create) do |link|
link.service.update_attribute(:enabled, false)
link.service.update(enabled: false)
end
end
end

0 comments on commit 2d6b614

Please sign in to comment.