diff --git a/Gemfile b/Gemfile index c496708536..059452cc53 100644 --- a/Gemfile +++ b/Gemfile @@ -92,14 +92,15 @@ gem 'bootstrap-kaminari-views', '~> 0.0.3' gem 'bundler', '>= 1.5.0' gem 'coffee-rails', '~> 4.2' gem 'daemons', '~> 1.1.9' -gem 'delayed_job', '~> 4.1.0' +gem 'delayed_job', github: 'dsander/delayed_job', branch: 'rails51' gem 'delayed_job_active_record', github: 'dsander/delayed_job_active_record', branch: 'rails5' -gem 'devise','~> 4.2.0' +gem 'devise',github: 'jcoyne/devise', branch: 'rails-5.1' +gem 'responders', github: 'plataformatec/responders', ref: '153f2c6' gem 'em-http-request', '~> 1.1.2' gem 'faraday', '~> 0.9' gem 'faraday_middleware', github: 'lostisland/faraday_middleware', branch: 'master' # '>= 0.10.1' gem 'feedjira', '~> 2.1' -gem 'font-awesome-sass', '~> 4.3.2' +gem 'font-awesome-sass', '~> 4.7.0' gem 'foreman', '~> 0.63.0' gem 'geokit', '~> 1.8.4' gem 'geokit-rails', '~> 2.2.0' @@ -117,9 +118,9 @@ gem 'mini_magick' gem 'multi_xml' gem 'nokogiri' gem 'omniauth', '~> 1.3.1' -gem 'rails', '~> 5.0.1' +gem 'rails', '~> 5.1.0' gem 'rufus-scheduler', '~> 3.3.2', require: false -gem 'sass-rails', '~> 5.0.6' +gem 'sass-rails', '~> 5.0' gem 'select2-rails', '~> 3.5.4' gem 'spectrum-rails' gem 'therubyracer', '~> 0.12.2' @@ -148,6 +149,7 @@ group :development do group :test do gem 'coveralls', '~> 0.7.4', require: false + gem 'capybara', '~> 2.13.0' gem 'capybara-select2', require: false gem 'delorean' gem 'poltergeist' @@ -162,7 +164,6 @@ group :development do gem 'shoulda-matchers' gem 'vcr' gem 'webmock', '~> 1.17.4', require: false - gem 'database_cleaner', '~> 1.5.3' end end diff --git a/Gemfile.lock b/Gemfile.lock index 000126370e..48e7f26068 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,13 +18,21 @@ GIT http_parser.rb (~> 0.6.0) simple_oauth (~> 0.3.0) +GIT + remote: https://github.com/dsander/delayed_job.git + revision: ec16c569ff0af1a71272b87ab8e070f113653c2d + branch: rails51 + specs: + delayed_job (4.1.2) + activesupport (>= 3.0, < 5.2) + GIT remote: https://github.com/dsander/delayed_job_active_record.git - revision: b314972ccc92e0e8b03b1589174d8fb9a82b3cd0 + revision: a9065168506cc2907c16859fdf76058b40e0cf5c branch: rails5 specs: delayed_job_active_record (4.1.1) - activerecord (>= 3.0, < 5.1) + activerecord (>= 3.0, < 5.2) delayed_job (>= 3.0, < 5) GIT @@ -38,6 +46,18 @@ GIT oauth2 (~> 1) rest-client (~> 1.8) +GIT + remote: https://github.com/jcoyne/devise.git + revision: 7c4e8c8d17047bceea490173af42bfbbc54cf849 + branch: rails-5.1 + specs: + devise (4.2.0) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0, < 5.2) + responders + warden (~> 1.2.3) + GIT remote: https://github.com/lostisland/faraday_middleware.git revision: 59088da02940d0ee2010b2e3156343346767c31e @@ -46,6 +66,14 @@ GIT faraday_middleware (0.10.0) faraday (>= 0.7.4, < 1.0) +GIT + remote: https://github.com/plataformatec/responders.git + revision: 153f2c603fcbd0adb90a15021a7cba53654a78e5 + ref: 153f2c6 + specs: + responders (2.3.0) + railties (>= 4.2.0, < 5.3) + GIT remote: https://github.com/tumblr/tumblr_client.git revision: 0c59b04e49f2a8c89860613b18cf4e8f978d8dc7 @@ -71,45 +99,46 @@ GEM remote: https://rubygems.org/ specs: ace-rails-ap (2.0.1) - actioncable (5.0.1) - actionpack (= 5.0.1) - nio4r (~> 1.2) + actioncable (5.1.0) + actionpack (= 5.1.0) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.1) - actionpack (= 5.0.1) - actionview (= 5.0.1) - activejob (= 5.0.1) + actionmailer (5.1.0) + actionpack (= 5.1.0) + actionview (= 5.1.0) + activejob (= 5.1.0) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.1) - actionview (= 5.0.1) - activesupport (= 5.0.1) + actionpack (5.1.0) + actionview (= 5.1.0) + activesupport (= 5.1.0) rack (~> 2.0) rack-test (~> 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.1) - activesupport (= 5.0.1) + actionview (5.1.0) + activesupport (= 5.1.0) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (5.0.1) - activesupport (= 5.0.1) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.1.0) + activesupport (= 5.1.0) globalid (>= 0.3.6) - activemodel (5.0.1) - activesupport (= 5.0.1) - activerecord (5.0.1) - activemodel (= 5.0.1) - activesupport (= 5.0.1) - arel (~> 7.0) - activesupport (5.0.1) + activemodel (5.1.0) + activesupport (= 5.1.0) + activerecord (5.1.0) + activemodel (= 5.1.0) + activesupport (= 5.1.0) + arel (~> 8.0) + activesupport (5.1.0) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.3.8) - arel (7.1.4) + addressable (2.5.1) + public_suffix (~> 2.0, >= 2.0.2) + arel (8.0.0) autoparse (0.3.3) addressable (>= 2.3.1) extlib (>= 0.9.15) @@ -138,7 +167,7 @@ GEM capistrano-rails (1.1.3) capistrano (~> 3.1) capistrano-bundler (~> 1.1) - capybara (2.6.2) + capybara (2.13.0) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -170,18 +199,9 @@ GEM crack (0.4.2) safe_yaml (~> 1.0.0) daemons (1.1.9) - database_cleaner (1.5.3) debug_inspector (0.0.2) - delayed_job (4.1.2) - activesupport (>= 3.0, < 5.1) delorean (2.1.0) chronic - devise (4.2.0) - bcrypt (~> 3.0) - orm_adapter (~> 0.1) - railties (>= 4.1.0, < 5.1) - responders - warden (~> 1.2.3) diff-lcs (1.3) docile (1.1.5) domain_name (0.5.24) @@ -204,6 +224,7 @@ GEM equalizer (0.0.11) erector (0.10.0) treetop (>= 1.2.3) + erubi (1.6.0) erubis (2.7.0) ethon (0.7.1) ffi (>= 1.3.0) @@ -222,8 +243,8 @@ GEM loofah (>= 2.0) sax-machine (>= 1.0) ffi (1.9.10) - font-awesome-sass (4.3.2.1) - sass (~> 3.2) + font-awesome-sass (4.7.0) + sass (>= 3.2) forecast_io (2.0.1) faraday hashie @@ -237,8 +258,8 @@ GEM geokit-rails (2.2.0) geokit (~> 1.5) rails (>= 3.0) - globalid (0.3.7) - activesupport (>= 4.1.0) + globalid (0.4.0) + activesupport (>= 4.2.0) google-api-client (0.7.1) addressable (>= 2.3.2) autoparse (>= 0.3.3) @@ -320,7 +341,7 @@ GEM lumberjack (1.0.10) macaddr (1.7.1) systemu (~> 2.6.2) - mail (2.6.4) + mail (2.6.5) mime-types (>= 1.16, < 4) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) @@ -342,7 +363,7 @@ GEM net-ssh (>= 2.6.5) net-ssh (3.0.2) netrc (0.10.3) - nio4r (1.2.1) + nio4r (2.0.0) nokogiri (1.7.1) mini_portile2 (~> 2.1.0) notiffany (0.0.8) @@ -399,22 +420,23 @@ GEM pry (~> 0.10) pry-rails (0.3.4) pry (>= 0.9.10) + public_suffix (2.0.5) rack (2.0.1) rack-livereload (0.3.16) rack rack-test (0.6.3) rack (>= 1.0) - rails (5.0.1) - actioncable (= 5.0.1) - actionmailer (= 5.0.1) - actionpack (= 5.0.1) - actionview (= 5.0.1) - activejob (= 5.0.1) - activemodel (= 5.0.1) - activerecord (= 5.0.1) - activesupport (= 5.0.1) + rails (5.1.0) + actioncable (= 5.1.0) + actionmailer (= 5.1.0) + actionpack (= 5.1.0) + actionview (= 5.1.0) + activejob (= 5.1.0) + activemodel (= 5.1.0) + activerecord (= 5.1.0) + activesupport (= 5.1.0) bundler (>= 1.3.0, < 2.0) - railties (= 5.0.1) + railties (= 5.1.0) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.1) actionpack (~> 5.x) @@ -425,9 +447,9 @@ GEM nokogiri (~> 1.6) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - railties (5.0.1) - actionpack (= 5.0.1) - activesupport (= 5.0.1) + railties (5.1.0) + actionpack (= 5.1.0) + activesupport (= 5.1.0) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -439,8 +461,6 @@ GEM rb-kqueue (0.2.4) ffi (>= 0.5.0) ref (2.0.0) - responders (2.3.0) - railties (>= 4.2.0, < 5.1) rest-client (1.8.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) @@ -482,7 +502,7 @@ GEM rufus-scheduler (3.3.2) tzinfo safe_yaml (1.0.4) - sass (3.4.14) + sass (3.4.23) sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) @@ -535,7 +555,7 @@ GEM ref thor (0.19.4) thread_safe (0.3.6) - tilt (2.0.5) + tilt (2.0.7) tins (1.10.1) treetop (1.5.3) polyglot (~> 0.3) @@ -556,7 +576,7 @@ GEM simple_oauth (~> 0.3.0) typhoeus (0.6.9) ethon (>= 0.7.1) - tzinfo (1.2.2) + tzinfo (1.2.3) thread_safe (~> 0.1) uglifier (2.7.2) execjs (>= 0.3.0) @@ -571,7 +591,7 @@ GEM macaddr (~> 1.0) uuidtools (2.1.5) vcr (2.9.2) - warden (1.2.6) + warden (1.2.7) rack (>= 1.0) web-console (3.3.1) actionview (>= 5.0) @@ -581,7 +601,7 @@ GEM webmock (1.17.4) addressable (>= 2.2.7) crack (>= 0.3.2) - websocket-driver (0.6.4) + websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) wunderground (1.2.0) @@ -605,15 +625,15 @@ DEPENDENCIES capistrano (~> 3.4.0) capistrano-bundler (~> 1.1.4) capistrano-rails (~> 1.1) + capybara (~> 2.13.0) capybara-select2 coffee-rails (~> 4.2) coveralls (~> 0.7.4) daemons (~> 1.1.9) - database_cleaner (~> 1.5.3) - delayed_job (~> 4.1.0) + delayed_job! delayed_job_active_record! delorean - devise (~> 4.2.0) + devise! dotenv! dotenv-rails! dropbox-api @@ -623,7 +643,7 @@ DEPENDENCIES faraday_middleware! feedjira (~> 2.1) ffi (>= 1.9.4) - font-awesome-sass (~> 4.3.2) + font-awesome-sass (~> 4.7.0) forecast_io (~> 2.0.0) foreman (~> 0.63.0) geokit (~> 1.8.4) @@ -665,9 +685,10 @@ DEPENDENCIES pry-byebug pry-rails rack-livereload (~> 0.3.16) - rails (~> 5.0.1) + rails (~> 5.1.0) rails-controller-testing rb-kqueue (>= 0.2) + responders! rr rspec (~> 3.5) rspec-collection_matchers (~> 1.1.0) @@ -676,7 +697,7 @@ DEPENDENCIES rturk (~> 2.12.1) ruby-growl (~> 4.1.0) rufus-scheduler (~> 3.3.2) - sass-rails (~> 5.0.6) + sass-rails (~> 5.0) select2-rails (~> 3.5.4) shoulda-matchers slack-notifier (~> 1.0.0) @@ -702,7 +723,7 @@ DEPENDENCIES xmpp4r (~> 0.5.6) RUBY VERSION - ruby 2.3.1p112 + ruby 2.3.3p222 BUNDLED WITH 1.14.6 diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 85a1237e51..564fe9a695 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -1,5 +1,5 @@ #= require jquery -#= require jquery_ujs +#= require rails-ujs #= require typeahead.bundle #= require bootstrap #= require select2 diff --git a/app/assets/stylesheets/agent_views/peak_detector_agent/show.css.scss b/app/assets/stylesheets/agent_views/peak_detector_agent/show.scss similarity index 100% rename from app/assets/stylesheets/agent_views/peak_detector_agent/show.css.scss rename to app/assets/stylesheets/agent_views/peak_detector_agent/show.scss diff --git a/app/assets/stylesheets/application.css.scss.erb b/app/assets/stylesheets/application.scss.erb similarity index 100% rename from app/assets/stylesheets/application.css.scss.erb rename to app/assets/stylesheets/application.scss.erb diff --git a/app/assets/stylesheets/diagram.css.scss b/app/assets/stylesheets/diagram.scss similarity index 100% rename from app/assets/stylesheets/diagram.css.scss rename to app/assets/stylesheets/diagram.scss diff --git a/app/assets/stylesheets/jobs.css.scss b/app/assets/stylesheets/jobs.scss similarity index 100% rename from app/assets/stylesheets/jobs.css.scss rename to app/assets/stylesheets/jobs.scss diff --git a/app/assets/stylesheets/scenarios.css.scss b/app/assets/stylesheets/scenarios.scss similarity index 100% rename from app/assets/stylesheets/scenarios.css.scss rename to app/assets/stylesheets/scenarios.scss diff --git a/app/assets/stylesheets/tables.css.scss b/app/assets/stylesheets/tables.scss similarity index 100% rename from app/assets/stylesheets/tables.css.scss rename to app/assets/stylesheets/tables.scss diff --git a/app/assets/stylesheets/typeahead.css.scss b/app/assets/stylesheets/typeahead.scss similarity index 100% rename from app/assets/stylesheets/typeahead.css.scss rename to app/assets/stylesheets/typeahead.scss diff --git a/app/models/agent.rb b/app/models/agent.rb index 873fac7509..4c12222379 100644 --- a/app/models/agent.rb +++ b/app/models/agent.rb @@ -48,10 +48,10 @@ class Agent < ActiveRecord::Base has_many :events, -> { order("events.id desc") }, :dependent => :delete_all, :inverse_of => :agent has_one :most_recent_event, -> { order("events.id desc") }, :inverse_of => :agent, :class_name => "Event" has_many :logs, -> { order("agent_logs.id desc") }, :dependent => :delete_all, :inverse_of => :agent, :class_name => "AgentLog" - has_many :received_events, -> { order("events.id desc") }, :through => :sources, :class_name => "Event", :source => :events has_many :links_as_source, :dependent => :delete_all, :foreign_key => "source_id", :class_name => "Link", :inverse_of => :source has_many :links_as_receiver, :dependent => :delete_all, :foreign_key => "receiver_id", :class_name => "Link", :inverse_of => :receiver has_many :sources, :through => :links_as_receiver, :class_name => "Agent", :inverse_of => :receivers + has_many :received_events, -> { order("events.id desc") }, :through => :sources, :class_name => "Event", :source => :events has_many :receivers, :through => :links_as_source, :class_name => "Agent", :inverse_of => :sources has_many :control_links_as_controller, dependent: :delete_all, foreign_key: 'controller_id', class_name: 'ControlLink', inverse_of: :controller has_many :control_links_as_control_target, dependent: :delete_all, foreign_key: 'control_target_id', class_name: 'ControlLink', inverse_of: :control_target @@ -259,7 +259,7 @@ def set_last_checked_event_id end def possibly_update_event_expirations - update_event_expirations! if keep_events_for_changed? + update_event_expirations! if saved_change_to_keep_events_for? end #Validation Methods diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 823a908ad7..8134567735 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -44,7 +44,7 @@ - <%= paginate @events, params: params.slice(:hl), theme: 'twitter-bootstrap-3' %> + <%= paginate @events, params: params.to_unsafe_h.slice(:hl), theme: 'twitter-bootstrap-3' %>
diff --git a/config/application.rb b/config/application.rb index 10fb8f3612..5abb84c965 100644 --- a/config/application.rb +++ b/config/application.rb @@ -10,6 +10,9 @@ module Huginn class Application < Rails::Application Dotenv.overload File.expand_path('../../spec/env.test', __FILE__) if Rails.env.test? + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 5.1 + # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. diff --git a/config/environments/production.rb b/config/environments/production.rb index 6ac215c7a8..55772b0405 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -14,6 +14,11 @@ config.consider_all_requests_local = false config.action_controller.perform_caching = true + # Attempt to read encrypted secrets from `config/secrets.yml.enc`. + # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or + # `config/secrets.yml.key`. + config.read_encrypted_secrets = false + # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb deleted file mode 100644 index 0706cafd4e..0000000000 --- a/config/initializers/new_framework_defaults.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file contains migration options to ease your Rails 5.0 upgrade. -# -# Read the Rails 5.0 release notes for more info on each option. - -# Enable per-form CSRF tokens. Previous versions had false. -Rails.application.config.action_controller.per_form_csrf_tokens = true - -# Enable origin-checking CSRF mitigation. Previous versions had false. -Rails.application.config.action_controller.forgery_protection_origin_check = true - -# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. -# Previous versions had false. -ActiveSupport.to_time_preserves_timezone = true - -# Require `belongs_to` associations by default. Previous versions had false. -Rails.application.config.active_record.belongs_to_required_by_default = true - -# Do not halt callback chains when a callback returns false. Previous versions had true. -ActiveSupport.halt_callback_chains_on_return_false = false - -# Configure SSL options to enable HSTS with subdomains. Previous versions had false. -Rails.application.config.ssl_options = { hsts: { subdomains: true } } diff --git a/db/migrate/20120728210244_devise_create_users.rb b/db/migrate/20120728210244_devise_create_users.rb index 2099d998fa..258eae2a59 100644 --- a/db/migrate/20120728210244_devise_create_users.rb +++ b/db/migrate/20120728210244_devise_create_users.rb @@ -1,4 +1,4 @@ -class DeviseCreateUsers < ActiveRecord::Migration +class DeviseCreateUsers < ActiveRecord::Migration[4.2] def change create_table(:users) do |t| ## Database authenticatable diff --git a/db/migrate/20120728215449_add_admin_to_users.rb b/db/migrate/20120728215449_add_admin_to_users.rb index bdbaee6cd4..615fd52bb6 100644 --- a/db/migrate/20120728215449_add_admin_to_users.rb +++ b/db/migrate/20120728215449_add_admin_to_users.rb @@ -1,4 +1,4 @@ -class AddAdminToUsers < ActiveRecord::Migration +class AddAdminToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :admin, :boolean, :default => false, :null => false end diff --git a/db/migrate/20120919061122_enable_lockable_strategy_for_devise.rb b/db/migrate/20120919061122_enable_lockable_strategy_for_devise.rb index dcced96e86..3e47a9ef07 100644 --- a/db/migrate/20120919061122_enable_lockable_strategy_for_devise.rb +++ b/db/migrate/20120919061122_enable_lockable_strategy_for_devise.rb @@ -1,4 +1,4 @@ -class EnableLockableStrategyForDevise < ActiveRecord::Migration +class EnableLockableStrategyForDevise < ActiveRecord::Migration[4.2] def up add_column :users, :failed_attempts, :integer, :default => 0 add_column :users, :unlock_token, :string diff --git a/db/migrate/20120919063304_add_username_to_users.rb b/db/migrate/20120919063304_add_username_to_users.rb index 5c9a484c41..e21557cd6a 100644 --- a/db/migrate/20120919063304_add_username_to_users.rb +++ b/db/migrate/20120919063304_add_username_to_users.rb @@ -1,4 +1,4 @@ -class AddUsernameToUsers < ActiveRecord::Migration +class AddUsernameToUsers < ActiveRecord::Migration[4.2] class User < ActiveRecord::Base end diff --git a/db/migrate/20121216025930_create_events.rb b/db/migrate/20121216025930_create_events.rb index 058ab09200..f3f3f07469 100644 --- a/db/migrate/20121216025930_create_events.rb +++ b/db/migrate/20121216025930_create_events.rb @@ -1,4 +1,4 @@ -class CreateEvents < ActiveRecord::Migration +class CreateEvents < ActiveRecord::Migration[4.2] def change create_table :events do |t| t.integer :user_id diff --git a/db/migrate/20121220053905_create_agents.rb b/db/migrate/20121220053905_create_agents.rb index 4e6dc75af5..befad5d740 100644 --- a/db/migrate/20121220053905_create_agents.rb +++ b/db/migrate/20121220053905_create_agents.rb @@ -1,4 +1,4 @@ -class CreateAgents < ActiveRecord::Migration +class CreateAgents < ActiveRecord::Migration[4.2] def change create_table :agents do |t| t.integer :user_id diff --git a/db/migrate/20121222074732_create_links.rb b/db/migrate/20121222074732_create_links.rb index adfe4efff3..ab14df7b3d 100644 --- a/db/migrate/20121222074732_create_links.rb +++ b/db/migrate/20121222074732_create_links.rb @@ -1,4 +1,4 @@ -class CreateLinks < ActiveRecord::Migration +class CreateLinks < ActiveRecord::Migration[4.2] def change create_table :links do |t| t.integer :source_id diff --git a/db/migrate/20121223203701_create_delayed_jobs.rb b/db/migrate/20121223203701_create_delayed_jobs.rb index e7841608cc..acba7da264 100644 --- a/db/migrate/20121223203701_create_delayed_jobs.rb +++ b/db/migrate/20121223203701_create_delayed_jobs.rb @@ -1,4 +1,4 @@ -class CreateDelayedJobs < ActiveRecord::Migration +class CreateDelayedJobs < ActiveRecord::Migration[4.2] def self.up create_table :delayed_jobs, :force => true do |table| table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue diff --git a/db/migrate/20121231170705_add_memory_to_agents.rb b/db/migrate/20121231170705_add_memory_to_agents.rb index c5a82c9f6d..7cae48a253 100644 --- a/db/migrate/20121231170705_add_memory_to_agents.rb +++ b/db/migrate/20121231170705_add_memory_to_agents.rb @@ -1,4 +1,4 @@ -class AddMemoryToAgents < ActiveRecord::Migration +class AddMemoryToAgents < ActiveRecord::Migration[4.2] def change add_column :agents, :memory, :text end diff --git a/db/migrate/20130107050049_add_invitation_code_to_users.rb b/db/migrate/20130107050049_add_invitation_code_to_users.rb index 95a14a1416..f7aae38351 100644 --- a/db/migrate/20130107050049_add_invitation_code_to_users.rb +++ b/db/migrate/20130107050049_add_invitation_code_to_users.rb @@ -1,4 +1,4 @@ -class AddInvitationCodeToUsers < ActiveRecord::Migration +class AddInvitationCodeToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :invitation_code, :string change_column :users, :invitation_code, :string, :null => false diff --git a/db/migrate/20130124050117_add_indexes.rb b/db/migrate/20130124050117_add_indexes.rb index 1498bb9bae..0514e3490b 100644 --- a/db/migrate/20130124050117_add_indexes.rb +++ b/db/migrate/20130124050117_add_indexes.rb @@ -1,4 +1,4 @@ -class AddIndexes < ActiveRecord::Migration +class AddIndexes < ActiveRecord::Migration[4.2] def change add_index :links, [:receiver_id, :source_id] end diff --git a/db/migrate/20130126080736_change_memory_to_long_text.rb b/db/migrate/20130126080736_change_memory_to_long_text.rb index 3343aa27d6..7a5261d248 100644 --- a/db/migrate/20130126080736_change_memory_to_long_text.rb +++ b/db/migrate/20130126080736_change_memory_to_long_text.rb @@ -1,6 +1,6 @@ # PG allows arbitrarily long text fields but MySQL has default limits. Make those limits larger if we're using MySQL. -class ChangeMemoryToLongText < ActiveRecord::Migration +class ChangeMemoryToLongText < ActiveRecord::Migration[4.2] def up if mysql? change_column :agents, :memory, :text, :limit => 4294967295 diff --git a/db/migrate/20130509053743_add_last_webhook_at_to_agents.rb b/db/migrate/20130509053743_add_last_webhook_at_to_agents.rb index 2623f9a80f..bc972e6115 100644 --- a/db/migrate/20130509053743_add_last_webhook_at_to_agents.rb +++ b/db/migrate/20130509053743_add_last_webhook_at_to_agents.rb @@ -1,4 +1,4 @@ -class AddLastWebhookAtToAgents < ActiveRecord::Migration +class AddLastWebhookAtToAgents < ActiveRecord::Migration[4.2] def change add_column :agents, :last_webhook_at, :datetime end diff --git a/db/migrate/20130819160603_create_agent_logs.rb b/db/migrate/20130819160603_create_agent_logs.rb index 1c396602b8..dcaae895a8 100644 --- a/db/migrate/20130819160603_create_agent_logs.rb +++ b/db/migrate/20130819160603_create_agent_logs.rb @@ -1,4 +1,4 @@ -class CreateAgentLogs < ActiveRecord::Migration +class CreateAgentLogs < ActiveRecord::Migration[4.2] def change create_table :agent_logs do |t| t.integer :agent_id, :null => false diff --git a/db/migrate/20131105063248_add_expires_at_to_events.rb b/db/migrate/20131105063248_add_expires_at_to_events.rb index 78cba02634..6cada5b142 100644 --- a/db/migrate/20131105063248_add_expires_at_to_events.rb +++ b/db/migrate/20131105063248_add_expires_at_to_events.rb @@ -1,4 +1,4 @@ -class AddExpiresAtToEvents < ActiveRecord::Migration +class AddExpiresAtToEvents < ActiveRecord::Migration[4.2] def change add_column :events, :expires_at, :datetime add_index :events, :expires_at diff --git a/db/migrate/20131222211558_add_keep_events_for_to_agents.rb b/db/migrate/20131222211558_add_keep_events_for_to_agents.rb index bfd0b7fef4..52bf9f262d 100644 --- a/db/migrate/20131222211558_add_keep_events_for_to_agents.rb +++ b/db/migrate/20131222211558_add_keep_events_for_to_agents.rb @@ -1,4 +1,4 @@ -class AddKeepEventsForToAgents < ActiveRecord::Migration +class AddKeepEventsForToAgents < ActiveRecord::Migration[4.2] def change add_column :agents, :keep_events_for, :integer, :null => false, :default => 0 end diff --git a/db/migrate/20131223032112_switch_to_json_serialization.rb b/db/migrate/20131223032112_switch_to_json_serialization.rb index 0b43d55ccd..a2279ba304 100644 --- a/db/migrate/20131223032112_switch_to_json_serialization.rb +++ b/db/migrate/20131223032112_switch_to_json_serialization.rb @@ -1,4 +1,4 @@ -class SwitchToJsonSerialization < ActiveRecord::Migration +class SwitchToJsonSerialization < ActiveRecord::Migration[4.2] FIELDS = { :agents => [:options, :memory], :events => [:payload] diff --git a/db/migrate/20131227000021_add_cached_dates_to_agent.rb b/db/migrate/20131227000021_add_cached_dates_to_agent.rb index 6c2b6f622c..e56be7a2a2 100644 --- a/db/migrate/20131227000021_add_cached_dates_to_agent.rb +++ b/db/migrate/20131227000021_add_cached_dates_to_agent.rb @@ -1,4 +1,4 @@ -class AddCachedDatesToAgent < ActiveRecord::Migration +class AddCachedDatesToAgent < ActiveRecord::Migration[4.2] def up add_column :agents, :last_event_at, :datetime execute "UPDATE agents SET last_event_at = (SELECT created_at FROM events WHERE events.agent_id = agents.id ORDER BY id DESC LIMIT 1)" diff --git a/db/migrate/20140121075418_create_user_credentials.rb b/db/migrate/20140121075418_create_user_credentials.rb index 2a493effed..414711d70f 100644 --- a/db/migrate/20140121075418_create_user_credentials.rb +++ b/db/migrate/20140121075418_create_user_credentials.rb @@ -1,4 +1,4 @@ -class CreateUserCredentials < ActiveRecord::Migration +class CreateUserCredentials < ActiveRecord::Migration[4.2] def change create_table :user_credentials do |t| t.integer :user_id, :null => false diff --git a/db/migrate/20140127164931_change_handler_to_medium_text.rb b/db/migrate/20140127164931_change_handler_to_medium_text.rb index ad00e9beee..5fbb82a79c 100644 --- a/db/migrate/20140127164931_change_handler_to_medium_text.rb +++ b/db/migrate/20140127164931_change_handler_to_medium_text.rb @@ -1,6 +1,6 @@ # Increase handler size to 16MB (consistent with events.payload) -class ChangeHandlerToMediumText < ActiveRecord::Migration +class ChangeHandlerToMediumText < ActiveRecord::Migration[4.2] def up if mysql? change_column :delayed_jobs, :handler, :text, :limit => 16777215 @@ -16,4 +16,4 @@ def down def mysql? ActiveRecord::Base.connection.adapter_name =~ /mysql/i end -end \ No newline at end of file +end diff --git a/db/migrate/20140210062747_add_mode_to_user_credentials.rb b/db/migrate/20140210062747_add_mode_to_user_credentials.rb index 8b30a47d83..181e68a022 100644 --- a/db/migrate/20140210062747_add_mode_to_user_credentials.rb +++ b/db/migrate/20140210062747_add_mode_to_user_credentials.rb @@ -1,4 +1,4 @@ -class AddModeToUserCredentials < ActiveRecord::Migration +class AddModeToUserCredentials < ActiveRecord::Migration[4.2] def change add_column :user_credentials, :mode, :string, :default => 'text', :null => false end diff --git a/db/migrate/20140213053001_add_event_id_at_creation_to_links.rb b/db/migrate/20140213053001_add_event_id_at_creation_to_links.rb index 9c25a35781..c03e0e398c 100644 --- a/db/migrate/20140213053001_add_event_id_at_creation_to_links.rb +++ b/db/migrate/20140213053001_add_event_id_at_creation_to_links.rb @@ -1,4 +1,4 @@ -class AddEventIdAtCreationToLinks < ActiveRecord::Migration +class AddEventIdAtCreationToLinks < ActiveRecord::Migration[4.2] class Link < ActiveRecord::Base; end class Event < ActiveRecord::Base; end diff --git a/db/migrate/20140216201250_add_propagate_immediately_to_agent.rb b/db/migrate/20140216201250_add_propagate_immediately_to_agent.rb index 73ff785a08..ba8c6f7d0a 100644 --- a/db/migrate/20140216201250_add_propagate_immediately_to_agent.rb +++ b/db/migrate/20140216201250_add_propagate_immediately_to_agent.rb @@ -1,4 +1,4 @@ -class AddPropagateImmediatelyToAgent < ActiveRecord::Migration +class AddPropagateImmediatelyToAgent < ActiveRecord::Migration[4.2] def up add_column :agents, :propagate_immediately, :boolean, :default => false, :null => false end diff --git a/db/migrate/20140403043556_add_disabled_to_agent.rb b/db/migrate/20140403043556_add_disabled_to_agent.rb index 0efdff5e1b..53c7046b52 100644 --- a/db/migrate/20140403043556_add_disabled_to_agent.rb +++ b/db/migrate/20140403043556_add_disabled_to_agent.rb @@ -1,4 +1,4 @@ -class AddDisabledToAgent < ActiveRecord::Migration +class AddDisabledToAgent < ActiveRecord::Migration[4.2] def change add_column :agents, :disabled, :boolean, :default => false, :null => false end diff --git a/db/migrate/20140408150825_rename_webhook_to_web_request.rb b/db/migrate/20140408150825_rename_webhook_to_web_request.rb index c107595f94..0d9a671066 100644 --- a/db/migrate/20140408150825_rename_webhook_to_web_request.rb +++ b/db/migrate/20140408150825_rename_webhook_to_web_request.rb @@ -1,4 +1,4 @@ -class RenameWebhookToWebRequest < ActiveRecord::Migration +class RenameWebhookToWebRequest < ActiveRecord::Migration[4.2] def up rename_column :agents, :last_webhook_at, :last_web_request_at end diff --git a/db/migrate/20140505201716_migrate_agents_to_liquid_templating.rb b/db/migrate/20140505201716_migrate_agents_to_liquid_templating.rb index 6ae8cb85df..80a9c1fb08 100644 --- a/db/migrate/20140505201716_migrate_agents_to_liquid_templating.rb +++ b/db/migrate/20140505201716_migrate_agents_to_liquid_templating.rb @@ -1,6 +1,6 @@ require 'liquid_migrator' -class MigrateAgentsToLiquidTemplating < ActiveRecord::Migration +class MigrateAgentsToLiquidTemplating < ActiveRecord::Migration[4.2] class Agent < ActiveRecord::Base include JSONSerializedField json_serialize :options, :memory diff --git a/db/migrate/20140509170420_create_scenarios.rb b/db/migrate/20140509170420_create_scenarios.rb index 955206f513..04fdd43d7b 100644 --- a/db/migrate/20140509170420_create_scenarios.rb +++ b/db/migrate/20140509170420_create_scenarios.rb @@ -1,4 +1,4 @@ -class CreateScenarios < ActiveRecord::Migration +class CreateScenarios < ActiveRecord::Migration[4.2] def change create_table :scenarios do |t| t.string :name, :null => false diff --git a/db/migrate/20140509170443_create_scenario_memberships.rb b/db/migrate/20140509170443_create_scenario_memberships.rb index 444dd2669a..b99c50b895 100644 --- a/db/migrate/20140509170443_create_scenario_memberships.rb +++ b/db/migrate/20140509170443_create_scenario_memberships.rb @@ -1,4 +1,4 @@ -class CreateScenarioMemberships < ActiveRecord::Migration +class CreateScenarioMemberships < ActiveRecord::Migration[4.2] def change create_table :scenario_memberships do |t| t.integer :agent_id, :null => false diff --git a/db/migrate/20140515211100_create_services.rb b/db/migrate/20140515211100_create_services.rb index 7499bb00fc..2b514369c4 100644 --- a/db/migrate/20140515211100_create_services.rb +++ b/db/migrate/20140515211100_create_services.rb @@ -1,4 +1,4 @@ -class CreateServices < ActiveRecord::Migration +class CreateServices < ActiveRecord::Migration[4.2] def change create_table :services do |t| t.integer :user_id, null: false diff --git a/db/migrate/20140525150040_add_service_id_to_agents.rb b/db/migrate/20140525150040_add_service_id_to_agents.rb index ebbc6055b6..b62c982cc9 100644 --- a/db/migrate/20140525150040_add_service_id_to_agents.rb +++ b/db/migrate/20140525150040_add_service_id_to_agents.rb @@ -1,4 +1,4 @@ -class AddServiceIdToAgents < ActiveRecord::Migration +class AddServiceIdToAgents < ActiveRecord::Migration[4.2] def change add_column :agents, :service_id, :integer end diff --git a/db/migrate/20140525150140_migrate_agents_to_service_authentication.rb b/db/migrate/20140525150140_migrate_agents_to_service_authentication.rb index 3745c2a567..c0e0fc5580 100644 --- a/db/migrate/20140525150140_migrate_agents_to_service_authentication.rb +++ b/db/migrate/20140525150140_migrate_agents_to_service_authentication.rb @@ -1,4 +1,4 @@ -class MigrateAgentsToServiceAuthentication < ActiveRecord::Migration +class MigrateAgentsToServiceAuthentication < ActiveRecord::Migration[4.2] def twitter_consumer_key(agent) agent.options['consumer_key'].presence || agent.credential('twitter_consumer_key') end diff --git a/db/migrate/20140531232016_add_fields_to_scenarios.rb b/db/migrate/20140531232016_add_fields_to_scenarios.rb index 99191903a8..a171036a50 100644 --- a/db/migrate/20140531232016_add_fields_to_scenarios.rb +++ b/db/migrate/20140531232016_add_fields_to_scenarios.rb @@ -1,4 +1,4 @@ -class AddFieldsToScenarios < ActiveRecord::Migration +class AddFieldsToScenarios < ActiveRecord::Migration[4.2] def change add_column :scenarios, :description, :text add_column :scenarios, :public, :boolean, :default => false, :null => false diff --git a/db/migrate/20140602014917_add_indices_to_scenarios.rb b/db/migrate/20140602014917_add_indices_to_scenarios.rb index 5774cf5b47..48eaf42b67 100644 --- a/db/migrate/20140602014917_add_indices_to_scenarios.rb +++ b/db/migrate/20140602014917_add_indices_to_scenarios.rb @@ -1,4 +1,4 @@ -class AddIndicesToScenarios < ActiveRecord::Migration +class AddIndicesToScenarios < ActiveRecord::Migration[4.2] def change add_index :scenarios, [:user_id, :guid], :unique => true add_index :scenario_memberships, :agent_id diff --git a/db/migrate/20140603104211_rename_digest_email_to_email_digest.rb b/db/migrate/20140603104211_rename_digest_email_to_email_digest.rb index 321a26b003..c2a67c3676 100644 --- a/db/migrate/20140603104211_rename_digest_email_to_email_digest.rb +++ b/db/migrate/20140603104211_rename_digest_email_to_email_digest.rb @@ -1,4 +1,4 @@ -class RenameDigestEmailToEmailDigest < ActiveRecord::Migration +class RenameDigestEmailToEmailDigest < ActiveRecord::Migration[4.2] def up sql = <<-SQL UPDATE #{ActiveRecord::Base.connection.quote_table_name('agents')} diff --git a/db/migrate/20140605032822_add_guid_to_agents.rb b/db/migrate/20140605032822_add_guid_to_agents.rb index f13be9b1d0..1c36e45f02 100644 --- a/db/migrate/20140605032822_add_guid_to_agents.rb +++ b/db/migrate/20140605032822_add_guid_to_agents.rb @@ -1,4 +1,4 @@ -class AddGuidToAgents < ActiveRecord::Migration +class AddGuidToAgents < ActiveRecord::Migration[4.2] class Agent < ActiveRecord::Base; end def change @@ -12,4 +12,4 @@ def change add_index :agents, :guid end -end \ No newline at end of file +end diff --git a/db/migrate/20140722131220_convert_efa_skip_agent.rb b/db/migrate/20140722131220_convert_efa_skip_agent.rb index d2d092148d..64fed28119 100644 --- a/db/migrate/20140722131220_convert_efa_skip_agent.rb +++ b/db/migrate/20140722131220_convert_efa_skip_agent.rb @@ -1,4 +1,4 @@ -class ConvertEfaSkipAgent < ActiveRecord::Migration +class ConvertEfaSkipAgent < ActiveRecord::Migration[4.2] def up Agent.where(type: 'Agents::EventFormattingAgent').each do |agent| agent.options_will_change! diff --git a/db/migrate/20140723110551_adopt_xpath_in_website_agent.rb b/db/migrate/20140723110551_adopt_xpath_in_website_agent.rb index 30089f6af8..fb4bd61f2f 100644 --- a/db/migrate/20140723110551_adopt_xpath_in_website_agent.rb +++ b/db/migrate/20140723110551_adopt_xpath_in_website_agent.rb @@ -1,4 +1,4 @@ -class AdoptXpathInWebsiteAgent < ActiveRecord::Migration +class AdoptXpathInWebsiteAgent < ActiveRecord::Migration[4.2] class Agent < ActiveRecord::Base include JSONSerializedField json_serialize :options diff --git a/db/migrate/20140730005210_convert_efa_skip_created_at.rb b/db/migrate/20140730005210_convert_efa_skip_created_at.rb index 8029fcf6d6..6312c36d42 100644 --- a/db/migrate/20140730005210_convert_efa_skip_created_at.rb +++ b/db/migrate/20140730005210_convert_efa_skip_created_at.rb @@ -1,4 +1,4 @@ -class ConvertEfaSkipCreatedAt < ActiveRecord::Migration +class ConvertEfaSkipCreatedAt < ActiveRecord::Migration[4.2] def up Agent.where(type: 'Agents::EventFormattingAgent').each do |agent| agent.options_will_change! diff --git a/db/migrate/20140809211540_remove_service_index_on_user_id.rb b/db/migrate/20140809211540_remove_service_index_on_user_id.rb index bc0c244afe..30959df34c 100644 --- a/db/migrate/20140809211540_remove_service_index_on_user_id.rb +++ b/db/migrate/20140809211540_remove_service_index_on_user_id.rb @@ -1,4 +1,4 @@ -class RemoveServiceIndexOnUserId < ActiveRecord::Migration +class RemoveServiceIndexOnUserId < ActiveRecord::Migration[4.2] def change remove_index :services, :user_id end diff --git a/db/migrate/20140811200922_add_uid_column_to_services.rb b/db/migrate/20140811200922_add_uid_column_to_services.rb index 7c1fc07e6f..4634049f31 100644 --- a/db/migrate/20140811200922_add_uid_column_to_services.rb +++ b/db/migrate/20140811200922_add_uid_column_to_services.rb @@ -1,4 +1,4 @@ -class AddUidColumnToServices < ActiveRecord::Migration +class AddUidColumnToServices < ActiveRecord::Migration[4.2] def change add_column :services, :uid, :string add_index :services, :uid diff --git a/db/migrate/20140813110107_set_charset_for_mysql.rb b/db/migrate/20140813110107_set_charset_for_mysql.rb index 1f98f9804e..b4c808ed42 100644 --- a/db/migrate/20140813110107_set_charset_for_mysql.rb +++ b/db/migrate/20140813110107_set_charset_for_mysql.rb @@ -1,4 +1,4 @@ -class SetCharsetForMysql < ActiveRecord::Migration +class SetCharsetForMysql < ActiveRecord::Migration[4.2] def all_models @all_models ||= [ Agent, diff --git a/db/migrate/20140820003139_add_tag_color_to_scenarios.rb b/db/migrate/20140820003139_add_tag_color_to_scenarios.rb index d078b163fe..0ab2a8537e 100644 --- a/db/migrate/20140820003139_add_tag_color_to_scenarios.rb +++ b/db/migrate/20140820003139_add_tag_color_to_scenarios.rb @@ -1,4 +1,4 @@ -class AddTagColorToScenarios < ActiveRecord::Migration +class AddTagColorToScenarios < ActiveRecord::Migration[4.2] def change add_column :scenarios, :tag_bg_color, :string add_column :scenarios, :tag_fg_color, :string diff --git a/db/migrate/20140901143732_add_control_links.rb b/db/migrate/20140901143732_add_control_links.rb index 19a2f5a709..6793a5cffa 100644 --- a/db/migrate/20140901143732_add_control_links.rb +++ b/db/migrate/20140901143732_add_control_links.rb @@ -1,4 +1,4 @@ -class AddControlLinks < ActiveRecord::Migration +class AddControlLinks < ActiveRecord::Migration[4.2] def change create_table :control_links do |t| t.integer :controller_id, null: false diff --git a/db/migrate/20140906030139_set_events_count_default.rb b/db/migrate/20140906030139_set_events_count_default.rb index b5ec70edc5..f2c62320c2 100644 --- a/db/migrate/20140906030139_set_events_count_default.rb +++ b/db/migrate/20140906030139_set_events_count_default.rb @@ -1,4 +1,4 @@ -class SetEventsCountDefault < ActiveRecord::Migration +class SetEventsCountDefault < ActiveRecord::Migration[4.2] def up change_column_default(:agents, :events_count, 0) change_column_null(:agents, :events_count, false, 0) diff --git a/db/migrate/20150219213604_add_type_option_attribute_to_pushbullet_agents.rb b/db/migrate/20150219213604_add_type_option_attribute_to_pushbullet_agents.rb index 0fde69a9f9..c03d439087 100644 --- a/db/migrate/20150219213604_add_type_option_attribute_to_pushbullet_agents.rb +++ b/db/migrate/20150219213604_add_type_option_attribute_to_pushbullet_agents.rb @@ -1,4 +1,4 @@ -class AddTypeOptionAttributeToPushbulletAgents < ActiveRecord::Migration +class AddTypeOptionAttributeToPushbulletAgents < ActiveRecord::Migration[4.2] def up Agents::PushbulletAgent.find_each do |agent| if agent.options['type'].nil? diff --git a/db/migrate/20150507153436_update_keep_events_for_to_be_in_seconds.rb b/db/migrate/20150507153436_update_keep_events_for_to_be_in_seconds.rb index 3201888948..c6d3e78f1a 100644 --- a/db/migrate/20150507153436_update_keep_events_for_to_be_in_seconds.rb +++ b/db/migrate/20150507153436_update_keep_events_for_to_be_in_seconds.rb @@ -1,4 +1,4 @@ -class UpdateKeepEventsForToBeInSeconds < ActiveRecord::Migration +class UpdateKeepEventsForToBeInSeconds < ActiveRecord::Migration[4.2] class Agent < ActiveRecord::Base; end SECONDS_IN_DAY = 60 * 60 * 24 @@ -10,4 +10,4 @@ def up def down Agent.update_all ['keep_events_for = keep_events_for / ?', SECONDS_IN_DAY] end -end \ No newline at end of file +end diff --git a/db/migrate/20150808115436_remove_requirement_from_users_invitation_code.rb b/db/migrate/20150808115436_remove_requirement_from_users_invitation_code.rb index b1e01fea56..c589da4d96 100644 --- a/db/migrate/20150808115436_remove_requirement_from_users_invitation_code.rb +++ b/db/migrate/20150808115436_remove_requirement_from_users_invitation_code.rb @@ -1,4 +1,4 @@ -class RemoveRequirementFromUsersInvitationCode < ActiveRecord::Migration +class RemoveRequirementFromUsersInvitationCode < ActiveRecord::Migration[4.2] def change change_column_null :users, :invitation_code, true, ENV['INVITATION_CODE'].presence || 'try-huginn' end diff --git a/db/migrate/20160108221620_website_agent_does_not_use_event_url.rb b/db/migrate/20160108221620_website_agent_does_not_use_event_url.rb index 1049f841c3..04af13b95a 100644 --- a/db/migrate/20160108221620_website_agent_does_not_use_event_url.rb +++ b/db/migrate/20160108221620_website_agent_does_not_use_event_url.rb @@ -1,4 +1,4 @@ -class WebsiteAgentDoesNotUseEventUrl < ActiveRecord::Migration +class WebsiteAgentDoesNotUseEventUrl < ActiveRecord::Migration[4.2] def up # Until this migration, if a WebsiteAgent received Events and did not have a `url_from_event` option set, # it would use the `url` from the Event's payload. If the Event did not have a `url` in its payload, the diff --git a/db/migrate/20160224120316_add_mode_option_to_ftpsite_agents.rb b/db/migrate/20160224120316_add_mode_option_to_ftpsite_agents.rb index 0061bf4afa..8a1c949043 100644 --- a/db/migrate/20160224120316_add_mode_option_to_ftpsite_agents.rb +++ b/db/migrate/20160224120316_add_mode_option_to_ftpsite_agents.rb @@ -1,4 +1,4 @@ -class AddModeOptionToFtpsiteAgents < ActiveRecord::Migration +class AddModeOptionToFtpsiteAgents < ActiveRecord::Migration[4.2] def up Agents::FtpsiteAgent.find_each do |agent| agent.options['mode'] = 'read' diff --git a/db/migrate/20160301113717_add_confirmable_attributes_to_users.rb b/db/migrate/20160301113717_add_confirmable_attributes_to_users.rb index 1e6ca1cfed..a886029bd5 100644 --- a/db/migrate/20160301113717_add_confirmable_attributes_to_users.rb +++ b/db/migrate/20160301113717_add_confirmable_attributes_to_users.rb @@ -1,4 +1,4 @@ -class AddConfirmableAttributesToUsers < ActiveRecord::Migration +class AddConfirmableAttributesToUsers < ActiveRecord::Migration[4.2] def change change_table(:users) do |t| ## Confirmable diff --git a/db/migrate/20160302095413_add_deactivated_at_to_users.rb b/db/migrate/20160302095413_add_deactivated_at_to_users.rb index da5b352bf6..0d9a8299c7 100644 --- a/db/migrate/20160302095413_add_deactivated_at_to_users.rb +++ b/db/migrate/20160302095413_add_deactivated_at_to_users.rb @@ -1,4 +1,4 @@ -class AddDeactivatedAtToUsers < ActiveRecord::Migration +class AddDeactivatedAtToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :deactivated_at, :datetime diff --git a/db/migrate/20160307084729_add_deactivated_to_agents.rb b/db/migrate/20160307084729_add_deactivated_to_agents.rb index d2d20b0396..6c1419349e 100644 --- a/db/migrate/20160307084729_add_deactivated_to_agents.rb +++ b/db/migrate/20160307084729_add_deactivated_to_agents.rb @@ -1,4 +1,4 @@ -class AddDeactivatedToAgents < ActiveRecord::Migration +class AddDeactivatedToAgents < ActiveRecord::Migration[4.2] def change add_column :agents, :deactivated, :boolean, default: false add_index :agents, [:disabled, :deactivated] diff --git a/db/migrate/20160307085545_warn_about_duplicate_usernames.rb b/db/migrate/20160307085545_warn_about_duplicate_usernames.rb index 966cf6c69a..426a464887 100644 --- a/db/migrate/20160307085545_warn_about_duplicate_usernames.rb +++ b/db/migrate/20160307085545_warn_about_duplicate_usernames.rb @@ -1,4 +1,4 @@ -class WarnAboutDuplicateUsernames < ActiveRecord::Migration +class WarnAboutDuplicateUsernames < ActiveRecord::Migration[4.2] def up names = User.group('LOWER(username)').having('count(*) > 1').pluck('LOWER(username)') if names.length > 0 diff --git a/db/migrate/20160405072512_post_agent_set_event_header_style.rb b/db/migrate/20160405072512_post_agent_set_event_header_style.rb index f00c4f6830..a6abb836a0 100644 --- a/db/migrate/20160405072512_post_agent_set_event_header_style.rb +++ b/db/migrate/20160405072512_post_agent_set_event_header_style.rb @@ -1,4 +1,4 @@ -class PostAgentSetEventHeaderStyle < ActiveRecord::Migration +class PostAgentSetEventHeaderStyle < ActiveRecord::Migration[4.2] def up Agent.of_type("Agents::PostAgent").each do |post_agent| if post_agent.send(:boolify, post_agent.options['emit_events']) && diff --git a/db/migrate/20160419150930_add_icon_to_scenarios.rb b/db/migrate/20160419150930_add_icon_to_scenarios.rb index d4fca93e81..cd251dc0a2 100644 --- a/db/migrate/20160419150930_add_icon_to_scenarios.rb +++ b/db/migrate/20160419150930_add_icon_to_scenarios.rb @@ -1,4 +1,4 @@ -class AddIconToScenarios < ActiveRecord::Migration +class AddIconToScenarios < ActiveRecord::Migration[4.2] def change add_column :scenarios, :icon, :string end diff --git a/db/migrate/20160423163416_add_xml_namespace_option_to_data_output_agents.rb b/db/migrate/20160423163416_add_xml_namespace_option_to_data_output_agents.rb index 5e0b0c7015..038a575947 100644 --- a/db/migrate/20160423163416_add_xml_namespace_option_to_data_output_agents.rb +++ b/db/migrate/20160423163416_add_xml_namespace_option_to_data_output_agents.rb @@ -1,4 +1,4 @@ -class AddXmlNamespaceOptionToDataOutputAgents < ActiveRecord::Migration +class AddXmlNamespaceOptionToDataOutputAgents < ActiveRecord::Migration[4.2] def up Agents::DataOutputAgent.find_each do |agent| agent.options['ns_media'] = 'true' @@ -14,4 +14,4 @@ def down agent.save!(validate: false) end end -end \ No newline at end of file +end diff --git a/db/migrate/20160607055850_change_events_order_to_events_list_order.rb b/db/migrate/20160607055850_change_events_order_to_events_list_order.rb index b1313ba9d9..e5e661d12c 100644 --- a/db/migrate/20160607055850_change_events_order_to_events_list_order.rb +++ b/db/migrate/20160607055850_change_events_order_to_events_list_order.rb @@ -1,4 +1,4 @@ -class ChangeEventsOrderToEventsListOrder < ActiveRecord::Migration +class ChangeEventsOrderToEventsListOrder < ActiveRecord::Migration[4.2] def up Agents::DataOutputAgent.find_each do |agent| if value = agent.options.delete('events_order') diff --git a/db/migrate/20160807000122_remove_queue_from_email_digest_agent_memory.rb b/db/migrate/20160807000122_remove_queue_from_email_digest_agent_memory.rb index b5db693ff4..22ac80f7dd 100644 --- a/db/migrate/20160807000122_remove_queue_from_email_digest_agent_memory.rb +++ b/db/migrate/20160807000122_remove_queue_from_email_digest_agent_memory.rb @@ -1,4 +1,4 @@ -class RemoveQueueFromEmailDigestAgentMemory < ActiveRecord::Migration +class RemoveQueueFromEmailDigestAgentMemory < ActiveRecord::Migration[4.2] def up Agents::EmailDigestAgent.find_each do |agent| agent.memory.delete("queue") diff --git a/db/migrate/20160823151303_set_emit_error_event_for_twitter_action_agents.rb b/db/migrate/20160823151303_set_emit_error_event_for_twitter_action_agents.rb index b38d97b0fa..57eee86800 100644 --- a/db/migrate/20160823151303_set_emit_error_event_for_twitter_action_agents.rb +++ b/db/migrate/20160823151303_set_emit_error_event_for_twitter_action_agents.rb @@ -1,4 +1,4 @@ -class SetEmitErrorEventForTwitterActionAgents < ActiveRecord::Migration +class SetEmitErrorEventForTwitterActionAgents < ActiveRecord::Migration[4.2] def up Agents::TwitterActionAgent.find_each do |agent| agent.options['emit_error_events'] = 'true' diff --git a/db/migrate/20161004120214_update_pushover_agent_options.rb b/db/migrate/20161004120214_update_pushover_agent_options.rb index 029b990575..9ba47ccf84 100644 --- a/db/migrate/20161004120214_update_pushover_agent_options.rb +++ b/db/migrate/20161004120214_update_pushover_agent_options.rb @@ -1,4 +1,4 @@ -class UpdatePushoverAgentOptions < ActiveRecord::Migration +class UpdatePushoverAgentOptions < ActiveRecord::Migration[4.2] DEFAULT_OPTIONS = { 'message' => '{{ message | default: text }}', 'device' => '{{ device }}', diff --git a/db/migrate/20161007030910_reset_data_output_agents.rb b/db/migrate/20161007030910_reset_data_output_agents.rb index 3c6e85db36..0487abfd7f 100644 --- a/db/migrate/20161007030910_reset_data_output_agents.rb +++ b/db/migrate/20161007030910_reset_data_output_agents.rb @@ -1,4 +1,4 @@ -class ResetDataOutputAgents < ActiveRecord::Migration +class ResetDataOutputAgents < ActiveRecord::Migration[4.2] def up Agents::DataOutputAgent.find_each do |agent| agent.memory = {} diff --git a/spec/capybara_helper.rb b/spec/capybara_helper.rb index f0d7c8a3c7..03195ec7df 100644 --- a/spec/capybara_helper.rb +++ b/spec/capybara_helper.rb @@ -19,16 +19,9 @@ config.before(:suite) do Warden.test_mode! - DatabaseCleaner.clean_with(:truncation) - end - - config.before(:each) do |example| - DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction - DatabaseCleaner.start end config.after(:each) do - DatabaseCleaner.clean Warden.test_reset! end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 8d97bdfee5..f31e0d091c 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,5 +1,3 @@ -ENV["RAILS_ENV"] ||= 'test' - if ENV['COVERAGE'] require 'simplecov' SimpleCov.start 'rails' @@ -38,7 +36,7 @@ # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. - config.use_transactional_fixtures = ENV['RSPEC_TASK'] == 'spec:nofeatures' + config.use_transactional_fixtures = true # rspec-rails 3 will no longer automatically infer an example group's spec type # from the file location. You can explicitly opt-in to this feature using this