diff --git a/.travis.yml b/.travis.yml index b7ca97ec265..f7ce2899edf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ branches: - master rvm: - - "2.4.1" + - "2.5.7" install: - docker-compose -f ./.travis/docker-compose-travis.yml build test-forum diff --git a/.travis/docker-compose-travis.yml b/.travis/docker-compose-travis.yml index 0e823c7d598..2edcc46591f 100644 --- a/.travis/docker-compose-travis.yml +++ b/.travis/docker-compose-travis.yml @@ -9,8 +9,7 @@ services: image: mongo:3.2.21 container_name: "mongo.edx" forum-base: - image: edxops/forum:latest - + image: edxops/forum:ruby257 # TODO: switch back to latest after configuration release container_name: forum_testing volumes: - ..:/edx/app/forum/cs_comments_service diff --git a/Gemfile b/Gemfile index 728fc1457f7..3058cfdf029 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby "2.4.1" +ruby "2.5.7" gem 'pry' gem 'pry-nav' @@ -16,19 +16,19 @@ gem 'sinatra-param', '~> 1.4' gem 'yajl-ruby', '~> 1.3.1' -gem 'activemodel', '~> 4.2.8' +gem 'activemodel' +gem 'protected_attributes_continued' -gem 'mongoid', '~> 5.0.0' -gem 'bson', '~> 3.1' +gem 'mongoid' +gem 'bson' gem 'bson_ext' -gem 'protected_attributes' gem 'delayed_job' gem 'delayed_job_mongoid' gem "enumerize" -gem 'mongoid-tree', :git => 'https://github.com/macdiesel/mongoid-tree' -gem 'rs_voteable_mongo', :git => 'https://github.com/navneet35371/voteable_mongo.git' +gem 'mongoid-tree', :git => 'https://github.com/edx/mongoid-tree' +gem 'rs_voteable_mongo', '~> 1.3' gem 'mongoid_magic_counter_cache' # Before updating will_paginate version, we need to make sure that property 'total_entries' diff --git a/Gemfile.lock b/Gemfile.lock index 5290fbdf97d..b145ab96d98 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,16 +1,9 @@ GIT - remote: https://github.com/macdiesel/mongoid-tree - revision: b381dd56f1b3b061df8f4b4181d5440dea1602d1 + remote: https://github.com/edx/mongoid-tree + revision: c7407871e32d472b98c3f31bc30a44118e4e6dfc specs: - mongoid-tree (2.0.0) - mongoid (>= 4.0, <= 5.0) - -GIT - remote: https://github.com/navneet35371/voteable_mongo.git - revision: 55fcfe76705ab5da1c9e5670594331b33954c545 - specs: - rs_voteable_mongo (1.0.2) - mongoid (>= 3.0, <= 5.0) + mongoid-tree (2.1.1) + mongoid (>= 4.0, < 8) GIT remote: https://github.com/rack/rack-contrib.git @@ -23,17 +16,18 @@ GIT GEM remote: https://rubygems.org/ specs: - activemodel (4.2.8) - activesupport (= 4.2.8) + activemodel (6.0.2.1) + activesupport (= 6.0.2.1) builder (~> 3.1) - activesupport (4.2.8) - i18n (~> 0.7) + activesupport (6.0.2.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + zeitwerk (~> 2.2) addressable (2.5.1) public_suffix (~> 2.0, >= 2.0.2) - bson (3.2.6) + bson (4.7.0) bson_ext (1.5.1) builder (3.2.3) codecov (0.1.10) @@ -41,14 +35,15 @@ GEM simplecov url coderay (1.1.1) + concurrent-ruby (1.1.5) crack (0.4.3) safe_yaml (~> 1.0.0) dalli (2.7.6) - delayed_job (4.1.3) - activesupport (>= 3.0, < 5.2) - delayed_job_mongoid (2.3.0) + delayed_job (4.1.8) + activesupport (>= 3.0, < 6.1) + delayed_job_mongoid (2.3.1) delayed_job (>= 3.0, < 5) - mongoid (>= 3.0, < 7) + mongoid (>= 3.0, < 8) mongoid-compatibility (>= 0.4.0) diff-lcs (1.3) docile (1.1.5) @@ -91,7 +86,8 @@ GEM hashie (3.5.5) http-cookie (1.0.3) domain_name (~> 0.5) - i18n (0.8.4) + i18n (0.9.5) + concurrent-ruby (~> 1.0) json (2.1.0) kgio (2.11.0) listen (3.1.5) @@ -104,12 +100,12 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.3.0) - minitest (5.10.2) - mongo (2.1.2) - bson (~> 3.0) - mongoid (5.0.0) - activemodel (~> 4.0) - mongo (~> 2.1) + minitest (5.14.0) + mongo (2.5.3) + bson (>= 4.3.0, < 5.0.0) + mongoid (7.0.5) + activemodel (>= 5.1, < 6.1) + mongo (>= 2.5.1, < 3.0.0) origin (~> 2.1) tzinfo (>= 0.3.37) mongoid-compatibility (0.4.1) @@ -131,8 +127,8 @@ GEM nenv (~> 0.1) shellany (~> 0.0) origin (2.3.1) - protected_attributes (1.1.4) - activemodel (>= 4.0.1, < 5.0) + protected_attributes_continued (1.5.0) + activemodel (>= 5.0) pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -156,6 +152,8 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + rs_voteable_mongo (1.3.0) + mongoid (~> 7.0) rspec (3.6.0) rspec-core (~> 3.6.0) rspec-expectations (~> 3.6.0) @@ -192,7 +190,7 @@ GEM thor (0.19.4) thread_safe (0.3.6) tilt (2.0.7) - tzinfo (1.2.3) + tzinfo (1.2.6) thread_safe (~> 0.1) unf (0.1.4) unf_ext @@ -210,13 +208,14 @@ GEM mongoid will_paginate (~> 3.0) yajl-ruby (1.3.1) + zeitwerk (2.2.2) PLATFORMS ruby DEPENDENCIES - activemodel (~> 4.2.8) - bson (~> 3.1) + activemodel + bson bson_ext bundler codecov @@ -231,13 +230,13 @@ DEPENDENCIES guard guard-unicorn i18n - mongoid (~> 5.0.0) + mongoid mongoid-tree! mongoid_cleaner (~> 1.2.0) mongoid_magic_counter_cache newrelic_rpm nokogiri (~> 1.8.1) - protected_attributes + protected_attributes_continued pry pry-nav rack-contrib! @@ -246,7 +245,7 @@ DEPENDENCIES rake rdiscount rest-client - rs_voteable_mongo! + rs_voteable_mongo (~> 1.3) rspec (~> 3.6.0) rspec-collection_matchers rspec-its @@ -258,7 +257,7 @@ DEPENDENCIES yajl-ruby (~> 1.3.1) RUBY VERSION - ruby 2.4.1p111 + ruby 2.5.7p206 BUNDLED WITH - 1.16.1 + 1.16.6 diff --git a/models/user.rb b/models/user.rb index 6b7872c1110..f94ad3419b2 100644 --- a/models/user.rb +++ b/models/user.rb @@ -8,6 +8,7 @@ class User field :_id, type: String, default: -> { external_id } field :external_id, type: String field :username, type: String + field :email, type: String field :default_sort_key, type: String, default: "date" embeds_many :read_states