diff --git a/.rubocop.yml b/.rubocop.yml index 12793ef90..a89826970 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,9 @@ AllCops: - 'db/migrate/20151210035820_init_schema.rb' - 'db/schema.rb' +Bundler/OrderedGems: + Enabled: false + Lint/BlockAlignment: Exclude: - 'lib/tasks/db.rake' @@ -29,6 +32,9 @@ Lint/Void: Metrics/AbcSize: Max: 160 +Metrics/BlockLength: + Enabled: false + Metrics/ClassLength: Max: 500 Exclude: @@ -134,6 +140,9 @@ Style/EmptyLinesAroundMethodBody: Style/EmptyLinesAroundModuleBody: Enabled: false +Style/EmptyMethod: + Enabled: false + Style/ExtraSpacing: Exclude: - 'bin/setup' diff --git a/bin/setup b/bin/setup index da92a1ec1..8abb67303 100755 --- a/bin/setup +++ b/bin/setup @@ -58,7 +58,7 @@ Dir.chdir APP_ROOT do require 'yaml' require 'erb' - db_config = YAML.load(ERB.new(File.read("config/database.yml")).result) + db_config = YAML.safe_load(ERB.new(File.read("config/database.yml")).result) if File.exist?(db_config['development']['database']) puts "Database already exists, running migrations..." system "bin/rake db:migrate" diff --git a/config/application.rb b/config/application.rb index 3da7b4b16..f7ef4ebbc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -37,7 +37,7 @@ class Application < Rails::Application config.middleware.insert_before 0, "Rack::Cors" do allow do origins 'bridgefoundry.org' - resource '/events.json', :headers => :any, :methods => [:get] + resource '/events.json', headers: :any, methods: [:get] end end end diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 9a3a3125b..fc9a9dbe3 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -477,10 +477,6 @@ @session1 = @event.event_sessions.first @session2 = create(:event_session, event: @event) - def deep_copy(o) - Marshal.load(Marshal.dump(o)) - end - expectation = { Role::VOLUNTEER.id => { @session1.id => [], @@ -491,8 +487,8 @@ def deep_copy(o) @session2.id => [] } } - @rsvps = deep_copy(expectation) - @checkins = deep_copy(expectation) + @rsvps = expectation.deep_dup + @checkins = expectation.deep_dup def add_rsvp(factory, session_checkins, additional_rsvp_options = {}) rsvp_options = {