diff --git a/.ruby-version b/.ruby-version index 2bf1c1ccf3..197c4d5c2d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.1 +2.4.0 diff --git a/Gemfile b/Gemfile index e59c56a537..3ec17c894d 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ group :preload do # AR extensions gem 'goldiloader' gem 'kaminari', '~> 0.17.0' - gem 'active_model_serializers' + gem 'active_model_serializers', git: 'https://github.com/rails-api/active_model_serializers.git' # need >0.10.3 gem 'paper_trail' gem 'soft_deletion' gem 'doorkeeper' diff --git a/Gemfile.lock b/Gemfile.lock index bcedb8dfef..59b88a9b13 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,13 @@ +GIT + remote: https://github.com/rails-api/active_model_serializers.git + revision: ec045a5388a983f45a53726b5f9dd4b3ddbf0abd + specs: + active_model_serializers (0.10.3) + actionpack (>= 4.1, < 6) + activemodel (>= 4.1, < 6) + case_transform (>= 0.2) + jsonapi (= 0.1.1.beta6) + PATH remote: plugins/airbrake specs: @@ -118,11 +128,6 @@ GEM rails-html-sanitizer (~> 1.0, >= 1.0.2) active_hash (1.4.1) activesupport (>= 2.2.2) - active_model_serializers (0.10.1) - actionpack (>= 4.1, < 6) - activemodel (>= 4.1, < 6) - jsonapi (~> 0.1.1.beta2) - railties (>= 4.1, < 6) activejob (5.0.1) activesupport (= 5.0.1) globalid (>= 0.3.6) @@ -169,10 +174,12 @@ GEM brakeman (3.4.1) builder (3.2.2) byebug (8.2.2) + case_transform (0.2) + activesupport cmd2json (0.2.0) json coderay (1.1.1) - concurrent-ruby (1.0.3) + concurrent-ruby (1.0.4) connection_pool (2.2.0) crack (0.4.3) safe_yaml (~> 1.0.0) @@ -212,7 +219,7 @@ GEM goldiloader (0.0.10) activerecord (>= 3.2, < 5.1) activesupport (>= 3.2, < 5.1) - hashdiff (0.3.0) + hashdiff (0.3.2) hashie (3.4.4) http (0.9.8) addressable (~> 2.3) @@ -223,8 +230,7 @@ GEM domain_name (~> 0.5) http-form_data (1.0.1) http_parser.rb (0.6.0) - httparty (0.13.7) - json (~> 1.8) + httparty (0.14.0) multi_xml (>= 0.5.2) i18n (0.7.0) inflection (1.0.0) @@ -236,10 +242,13 @@ GEM thor (>= 0.16.0) jmespath (1.2.4) json_pure (>= 1.8.1) - json (1.8.3) + json (2.0.2) json_pure (1.8.3) - jsonapi (0.1.1.beta2) - json (~> 1.8) + jsonapi (0.1.1.beta6) + jsonapi-parser (= 0.1.1.beta3) + jsonapi-renderer (= 0.1.1.beta1) + jsonapi-parser (0.1.1.beta3) + jsonapi-renderer (0.1.1.beta1) jwt (1.5.1) kaminari (0.17.0) actionpack (>= 3.0.0) @@ -271,13 +280,13 @@ GEM mocha (1.2.1) metaclass (~> 0.0.1) multi_json (1.12.0) - multi_xml (0.5.5) + multi_xml (0.6.0) multipart-post (2.0.0) mysql2 (0.4.4) net-http-persistent (2.9.4) net-ldap (0.14.0) netrc (0.11.0) - newrelic_rpm (3.15.2.317) + newrelic_rpm (3.17.2.327) ngannotate-rails (1.2.1) execjs rails (>= 3.1) @@ -403,9 +412,9 @@ GEM actionpack (~> 5.x) actionview (~> 5.x) activesupport (~> 5.x) - rails-dom-testing (2.0.1) + rails-dom-testing (2.0.2) activesupport (>= 4.2.0, < 6.0) - nokogiri (~> 1.6.0) + nokogiri (~> 1.6) rails-html-sanitizer (1.0.3) loofah (~> 2.0) railties (5.0.1) @@ -477,7 +486,7 @@ GEM vault (0.7.1) warden (1.2.6) rack (>= 1.0) - webmock (2.1.0) + webmock (2.3.1) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff @@ -497,7 +506,7 @@ PLATFORMS DEPENDENCIES active_hash - active_model_serializers + active_model_serializers! airbrake (~> 4.3.6) angular-rails-templates ansible @@ -606,7 +615,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 2.3.1p112 + ruby 2.4.0p0 BUNDLED WITH - 1.13.6 + 1.13.7 diff --git a/app/models/concerns/attr_encrypted_support.rb b/app/models/concerns/attr_encrypted_support.rb index c931069333..777e058db3 100644 --- a/app/models/concerns/attr_encrypted_support.rb +++ b/app/models/concerns/attr_encrypted_support.rb @@ -2,7 +2,7 @@ require 'attr_encrypted' module AttrEncryptedSupport - ENCRYPTION_KEY = Rails.application.secrets.secret_key_base + ENCRYPTION_KEY = Rails.application.secrets.secret_key_base[0...32] ENCRYPTION_KEY_SHA = Digest::SHA2.hexdigest(Rails.application.secrets.secret_key_base) def self.included(base) diff --git a/app/models/user.rb b/app/models/user.rb index 48b28221c6..f55650e86d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -26,9 +26,12 @@ class User < ActiveRecord::Base validates :external_id, presence: :true, unless: :integration? scope :search, ->(query) { - return self if query.blank? - query = ActiveRecord::Base.send(:sanitize_sql_like, query) - where("name LIKE ? OR email LIKE ?", "%#{query}%", "%#{query}%") + if query.blank? + self + else + query = ActiveRecord::Base.send(:sanitize_sql_like, query) + where("name LIKE ? OR email LIKE ?", "%#{query}%", "%#{query}%") + end } scope :with_role, -> (role_id, project_id) { joins("LEFT OUTER JOIN user_project_roles ON users.id = user_project_roles.user_id AND user_project_roles.project_id = #{project_id.to_i}"). # rubocop:disable Metrics/LineLength diff --git a/vendor/cache/active_model_serializers-0.10.1.gem b/vendor/cache/active_model_serializers-0.10.1.gem deleted file mode 100644 index 3470c165fb..0000000000 Binary files a/vendor/cache/active_model_serializers-0.10.1.gem and /dev/null differ diff --git a/vendor/cache/case_transform-0.2.gem b/vendor/cache/case_transform-0.2.gem new file mode 100644 index 0000000000..d6321eb265 Binary files /dev/null and b/vendor/cache/case_transform-0.2.gem differ diff --git a/vendor/cache/concurrent-ruby-1.0.3.gem b/vendor/cache/concurrent-ruby-1.0.3.gem deleted file mode 100644 index b946594b84..0000000000 Binary files a/vendor/cache/concurrent-ruby-1.0.3.gem and /dev/null differ diff --git a/vendor/cache/concurrent-ruby-1.0.4.gem b/vendor/cache/concurrent-ruby-1.0.4.gem new file mode 100644 index 0000000000..bf5baef513 Binary files /dev/null and b/vendor/cache/concurrent-ruby-1.0.4.gem differ diff --git a/vendor/cache/hashdiff-0.3.0.gem b/vendor/cache/hashdiff-0.3.0.gem deleted file mode 100644 index 7e99463dde..0000000000 Binary files a/vendor/cache/hashdiff-0.3.0.gem and /dev/null differ diff --git a/vendor/cache/hashdiff-0.3.2.gem b/vendor/cache/hashdiff-0.3.2.gem new file mode 100644 index 0000000000..c9da783586 Binary files /dev/null and b/vendor/cache/hashdiff-0.3.2.gem differ diff --git a/vendor/cache/httparty-0.13.7.gem b/vendor/cache/httparty-0.13.7.gem deleted file mode 100644 index 57d9a88e5b..0000000000 Binary files a/vendor/cache/httparty-0.13.7.gem and /dev/null differ diff --git a/vendor/cache/httparty-0.14.0.gem b/vendor/cache/httparty-0.14.0.gem new file mode 100644 index 0000000000..78e6e78220 Binary files /dev/null and b/vendor/cache/httparty-0.14.0.gem differ diff --git a/vendor/cache/json-1.8.3.gem b/vendor/cache/json-1.8.3.gem deleted file mode 100644 index 6474a4fcf3..0000000000 Binary files a/vendor/cache/json-1.8.3.gem and /dev/null differ diff --git a/vendor/cache/json-2.0.2.gem b/vendor/cache/json-2.0.2.gem new file mode 100644 index 0000000000..305b252813 Binary files /dev/null and b/vendor/cache/json-2.0.2.gem differ diff --git a/vendor/cache/jsonapi-0.1.1.beta2.gem b/vendor/cache/jsonapi-0.1.1.beta2.gem deleted file mode 100644 index 2c1b3fee71..0000000000 Binary files a/vendor/cache/jsonapi-0.1.1.beta2.gem and /dev/null differ diff --git a/vendor/cache/jsonapi-0.1.1.beta6.gem b/vendor/cache/jsonapi-0.1.1.beta6.gem new file mode 100644 index 0000000000..0ecee481da Binary files /dev/null and b/vendor/cache/jsonapi-0.1.1.beta6.gem differ diff --git a/vendor/cache/jsonapi-parser-0.1.1.beta3.gem b/vendor/cache/jsonapi-parser-0.1.1.beta3.gem new file mode 100644 index 0000000000..d5da8c7476 Binary files /dev/null and b/vendor/cache/jsonapi-parser-0.1.1.beta3.gem differ diff --git a/vendor/cache/jsonapi-renderer-0.1.1.beta1.gem b/vendor/cache/jsonapi-renderer-0.1.1.beta1.gem new file mode 100644 index 0000000000..036c12113f Binary files /dev/null and b/vendor/cache/jsonapi-renderer-0.1.1.beta1.gem differ diff --git a/vendor/cache/multi_xml-0.5.5.gem b/vendor/cache/multi_xml-0.5.5.gem deleted file mode 100644 index dbfc6e07b3..0000000000 Binary files a/vendor/cache/multi_xml-0.5.5.gem and /dev/null differ diff --git a/vendor/cache/multi_xml-0.6.0.gem b/vendor/cache/multi_xml-0.6.0.gem new file mode 100644 index 0000000000..77c5d002fc Binary files /dev/null and b/vendor/cache/multi_xml-0.6.0.gem differ diff --git a/vendor/cache/newrelic_rpm-3.15.2.317.gem b/vendor/cache/newrelic_rpm-3.15.2.317.gem deleted file mode 100644 index 9d636864df..0000000000 Binary files a/vendor/cache/newrelic_rpm-3.15.2.317.gem and /dev/null differ diff --git a/vendor/cache/newrelic_rpm-3.17.2.327.gem b/vendor/cache/newrelic_rpm-3.17.2.327.gem new file mode 100644 index 0000000000..04300330df Binary files /dev/null and b/vendor/cache/newrelic_rpm-3.17.2.327.gem differ diff --git a/vendor/cache/rails-dom-testing-2.0.1.gem b/vendor/cache/rails-dom-testing-2.0.1.gem deleted file mode 100644 index 32e47887fb..0000000000 Binary files a/vendor/cache/rails-dom-testing-2.0.1.gem and /dev/null differ diff --git a/vendor/cache/rails-dom-testing-2.0.2.gem b/vendor/cache/rails-dom-testing-2.0.2.gem new file mode 100644 index 0000000000..8ef3d0103d Binary files /dev/null and b/vendor/cache/rails-dom-testing-2.0.2.gem differ diff --git a/vendor/cache/webmock-2.1.0.gem b/vendor/cache/webmock-2.1.0.gem deleted file mode 100644 index a35c8f2f8f..0000000000 Binary files a/vendor/cache/webmock-2.1.0.gem and /dev/null differ diff --git a/vendor/cache/webmock-2.3.1.gem b/vendor/cache/webmock-2.3.1.gem new file mode 100644 index 0000000000..fc44d498d6 Binary files /dev/null and b/vendor/cache/webmock-2.3.1.gem differ