diff --git a/.rubocop.yml b/.rubocop.yml index 0b022cd..7d174e5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,3 +3,14 @@ Metrics/LineLength: Documentation: Enabled: false + +AllCops: + Include: + - '**/Rakefile' + - '**/config.ru' + Exclude: + - 'db/**/*' + - 'config/**/*' + - 'script/**/*' + - 'bin/**/*' + - !ruby/regexp /old_and_unused\.rb$/ diff --git a/app/models/photo.rb b/app/models/photo.rb index c58a5d6..ce0b17e 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -5,7 +5,7 @@ class Photo < ActiveRecord::Base validates :image, presence: true - @@per_page = 11 + self.per_page = 11 scope :enabled, -> { where(enabled: true) } diff --git a/config.ru b/config.ru index 230e0be..a2dea3d 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. -require ::File.expand_path('../config/environment', __FILE__) +require ::File.expand_path('../config/environment', __FILE__) run DanBarberPhoto::Application diff --git a/spec/support/ajax.rb b/spec/support/ajax.rb index 6789773..87c0816 100644 --- a/spec/support/ajax.rb +++ b/spec/support/ajax.rb @@ -1,6 +1,6 @@ module Ajax def wait_for_ajax - Timeout.timeout(Capybara.default_wait_time) do + Timeout.timeout(Capybara.default_max_wait_time) do loop do active = page.evaluate_script('jQuery.active') break if active == 0