diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b72fb0c0..9579c23a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ defaults: &defaults working_directory: ~/build docker: # specify the version you desire here - - image: circleci/ruby:2.7.0-node-browsers + - image: circleci/ruby:2.7.1-node-browsers # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images diff --git a/.ruby-version b/.ruby-version index 24ba9a38d..860487ca1 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.0 +2.7.1 diff --git a/Gemfile b/Gemfile index e8e2fa85b..61b3f4bcd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby '2.7.0' +ruby '2.7.1' ##-- base gems for rails --## gem 'rack-cors', require: 'rack/cors' diff --git a/Gemfile.lock b/Gemfile.lock index f26503fa4..1932d7e72 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -25,61 +25,61 @@ GEM specs: action-cable-testing (0.6.1) actioncable (>= 5.0) - actioncable (6.0.2.2) - actionpack (= 6.0.2.2) + actioncable (6.0.3) + actionpack (= 6.0.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.2.2) - actionpack (= 6.0.2.2) - activejob (= 6.0.2.2) - activerecord (= 6.0.2.2) - activestorage (= 6.0.2.2) - activesupport (= 6.0.2.2) + actionmailbox (6.0.3) + actionpack (= 6.0.3) + activejob (= 6.0.3) + activerecord (= 6.0.3) + activestorage (= 6.0.3) + activesupport (= 6.0.3) mail (>= 2.7.1) - actionmailer (6.0.2.2) - actionpack (= 6.0.2.2) - actionview (= 6.0.2.2) - activejob (= 6.0.2.2) + actionmailer (6.0.3) + actionpack (= 6.0.3) + actionview (= 6.0.3) + activejob (= 6.0.3) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.2.2) - actionview (= 6.0.2.2) - activesupport (= 6.0.2.2) + actionpack (6.0.3) + actionview (= 6.0.3) + activesupport (= 6.0.3) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.2.2) - actionpack (= 6.0.2.2) - activerecord (= 6.0.2.2) - activestorage (= 6.0.2.2) - activesupport (= 6.0.2.2) + actiontext (6.0.3) + actionpack (= 6.0.3) + activerecord (= 6.0.3) + activestorage (= 6.0.3) + activesupport (= 6.0.3) nokogiri (>= 1.8.5) - actionview (6.0.2.2) - activesupport (= 6.0.2.2) + actionview (6.0.3) + activesupport (= 6.0.3) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.2.2) - activesupport (= 6.0.2.2) + activejob (6.0.3) + activesupport (= 6.0.3) globalid (>= 0.3.6) - activemodel (6.0.2.2) - activesupport (= 6.0.2.2) - activerecord (6.0.2.2) - activemodel (= 6.0.2.2) - activesupport (= 6.0.2.2) - activestorage (6.0.2.2) - actionpack (= 6.0.2.2) - activejob (= 6.0.2.2) - activerecord (= 6.0.2.2) + activemodel (6.0.3) + activesupport (= 6.0.3) + activerecord (6.0.3) + activemodel (= 6.0.3) + activesupport (= 6.0.3) + activestorage (6.0.3) + actionpack (= 6.0.3) + activejob (= 6.0.3) + activerecord (= 6.0.3) marcel (~> 0.3.1) - activesupport (6.0.2.2) + activesupport (6.0.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - zeitwerk (~> 2.2) + zeitwerk (~> 2.2, >= 2.2.2) acts-as-taggable-on (6.5.0) activerecord (>= 5.0, < 6.1) addressable (2.7.0) @@ -90,8 +90,8 @@ GEM ast (2.4.0) attr_extras (6.2.3) aws-eventstream (1.1.0) - aws-partitions (1.296.0) - aws-sdk-core (3.94.0) + aws-partitions (1.310.0) + aws-sdk-core (3.94.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) @@ -99,11 +99,11 @@ GEM aws-sdk-kms (1.30.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.61.2) + aws-sdk-s3 (1.63.1) aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.1) + aws-sigv4 (1.1.3) aws-eventstream (~> 1.0, >= 1.0.2) axiom-types (0.1.1) descendants_tracker (~> 0.0.4) @@ -131,7 +131,7 @@ GEM bundler-audit (0.6.1) bundler (>= 1.2.0, < 3) thor (~> 0.18) - byebug (11.1.1) + byebug (11.1.3) chargebee (2.7.5) json_pure (~> 2.1) rest-client (>= 1.8, < 3.0) @@ -167,13 +167,13 @@ GEM equalizer (0.0.11) erubi (1.9.0) execjs (2.7.0) - facebook-messenger (1.4.1) + facebook-messenger (1.5.0) httparty (~> 0.13, >= 0.13.7) rack (>= 1.4.5) - factory_bot (5.1.2) + factory_bot (5.2.0) activesupport (>= 4.2.0) - factory_bot_rails (5.1.1) - factory_bot (~> 5.1.0) + factory_bot_rails (5.2.0) + factory_bot (~> 5.2.0) railties (>= 4.2.0) faker (2.11.0) i18n (>= 1.6, < 2) @@ -217,7 +217,7 @@ GEM groupdate (5.0.0) activesupport (>= 5) haikunator (1.1.0) - hana (1.3.5) + hana (1.3.6) hashie (4.1.0) hkdf (0.3.0) http-accept (1.7.0) @@ -272,8 +272,8 @@ GEM method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2019.1009) - mimemagic (0.3.4) + mime-types-data (3.2020.0425) + mimemagic (0.3.5) mini_magick (4.10.1) mini_mime (1.0.2) mini_portile2 (2.4.0) @@ -290,7 +290,7 @@ GEM orm_adapter (0.5.0) os (1.1.0) parallel (1.19.1) - parser (2.7.1.1) + parser (2.7.1.2) ast (~> 2.4.0) pg (1.2.3) pry (0.13.1) @@ -314,38 +314,38 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.2.2) - actioncable (= 6.0.2.2) - actionmailbox (= 6.0.2.2) - actionmailer (= 6.0.2.2) - actionpack (= 6.0.2.2) - actiontext (= 6.0.2.2) - actionview (= 6.0.2.2) - activejob (= 6.0.2.2) - activemodel (= 6.0.2.2) - activerecord (= 6.0.2.2) - activestorage (= 6.0.2.2) - activesupport (= 6.0.2.2) + rails (6.0.3) + actioncable (= 6.0.3) + actionmailbox (= 6.0.3) + actionmailer (= 6.0.3) + actionpack (= 6.0.3) + actiontext (= 6.0.3) + actionview (= 6.0.3) + activejob (= 6.0.3) + activemodel (= 6.0.3) + activerecord (= 6.0.3) + activestorage (= 6.0.3) + activesupport (= 6.0.3) bundler (>= 1.3.0) - railties (= 6.0.2.2) + railties (= 6.0.3) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.2.2) - actionpack (= 6.0.2.2) - activesupport (= 6.0.2.2) + railties (6.0.3) + actionpack (= 6.0.3) + activesupport (= 6.0.3) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) rainbow (3.0.0) rake (13.0.1) - rb-fsevent (0.10.3) + rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - redis (4.1.3) + redis (4.1.4) redis-namespace (1.7.0) redis (>= 3.0.4) redis-rack-cache (2.2.1) @@ -367,8 +367,8 @@ GEM netrc (~> 0.8) retriable (3.1.2) rexml (3.2.4) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) rspec-expectations (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) @@ -383,8 +383,8 @@ GEM rspec-expectations (~> 3.9) rspec-mocks (~> 3.9) rspec-support (~> 3.9) - rspec-support (3.9.2) - rubocop (0.81.0) + rspec-support (3.9.3) + rubocop (0.82.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.7.0.1) @@ -398,7 +398,7 @@ GEM activesupport rack (>= 1.1) rubocop (>= 0.72.0) - rubocop-rspec (1.38.1) + rubocop-rspec (1.39.0) rubocop (>= 0.68.1) ruby-progressbar (1.10.1) sass (3.7.4) @@ -418,7 +418,7 @@ GEM faraday (>= 1.0) shoulda-matchers (4.3.0) activesupport (>= 4.2.0) - sidekiq (6.0.6) + sidekiq (6.0.7) connection_pool (>= 2.2.2) rack (~> 2.0) rack-protection (>= 2.0.0) @@ -460,7 +460,7 @@ GEM nokogiri (>= 1.6, < 2.0) tzinfo (1.2.7) thread_safe (~> 0.1) - tzinfo-data (1.2019.3) + tzinfo-data (1.2020.1) tzinfo (>= 1.0.0) uber (0.1.0) uglifier (4.2.0) @@ -480,12 +480,12 @@ GEM equalizer (~> 0.0, >= 0.0.9) warden (1.2.8) rack (>= 2.0.6) - web-console (4.0.1) + web-console (4.0.2) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webpacker (5.0.1) + webpacker (5.1.1) activesupport (>= 5.2) rack-proxy (>= 0.6.1) railties (>= 5.2) @@ -576,7 +576,7 @@ DEPENDENCIES wisper (= 2.0.0) RUBY VERSION - ruby 2.7.0p0 + ruby 2.7.1p83 BUNDLED WITH - 2.1.2 + 2.1.4 diff --git a/app/jobs/action_cable_broadcast_job.rb b/app/jobs/action_cable_broadcast_job.rb index 5199cc771..aedae2c46 100644 --- a/app/jobs/action_cable_broadcast_job.rb +++ b/app/jobs/action_cable_broadcast_job.rb @@ -3,7 +3,7 @@ class ActionCableBroadcastJob < ApplicationJob def perform(members, event_name, data) members.each do |member| - ActionCable.server.broadcast(member, event: event_name, data: data) + ActionCable.server.broadcast(member, { event: event_name, data: data }) end end end diff --git a/app/models/conversation.rb b/app/models/conversation.rb index a6cc6b68e..d72202a98 100644 --- a/app/models/conversation.rb +++ b/app/models/conversation.rb @@ -180,7 +180,7 @@ class Conversation < ApplicationRecord def create_assignee_change(user_name) params = { assignee_name: assignee&.name, user_name: user_name }.compact key = assignee_id ? 'assigned' : 'removed' - content = I18n.t("conversations.activity.assignee.#{key}", params) + content = I18n.t("conversations.activity.assignee.#{key}", **params) messages.create(activity_message_params(content)) end diff --git a/config/environments/production.rb b/config/environments/production.rb index 65f609e49..b796d6acd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -66,7 +66,7 @@ Rails.application.configure do # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true + config.i18n.fallbacks = [I18n.default_locale] # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 35746997d..585f35da4 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -81,7 +81,7 @@ Rails.application.configure do # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true + config.i18n.fallbacks = [I18n.default_locale] config.active_job.queue_adapter = :sidekiq # Send deprecation notices to registered listeners. diff --git a/deployment/chatwoot-web.1.service b/deployment/chatwoot-web.1.service index 5885f618a..56d6a283c 100644 --- a/deployment/chatwoot-web.1.service +++ b/deployment/chatwoot-web.1.service @@ -16,10 +16,10 @@ KillMode=mixed StandardInput=null SyslogIdentifier=%p -Environment="PATH=/home/chatwoot/.rvm/gems/ruby-2.7.0/bin:/home/chatwoot/.rvm/gems/ruby-2.7.0@global/bin:/home/chatwoot/.rvm/rubies/ruby-2.7.0/bin:/home/chatwoot/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/chatwoot/.rvm/bin:/home/chatwoot/.rvm/bin" +Environment="PATH=/home/chatwoot/.rvm/gems/ruby-2.7.1/bin:/home/chatwoot/.rvm/gems/ruby-2.7.1@global/bin:/home/chatwoot/.rvm/rubies/ruby-2.7.1/bin:/home/chatwoot/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/chatwoot/.rvm/bin:/home/chatwoot/.rvm/bin" Environment="PORT=3000" Environment="RAILS_ENV=production" Environment="NODE_ENV=production" Environment="RAILS_LOG_TO_STDOUT=true" -Environment="GEM_HOME=/home/chatwoot/.rvm/gems/ruby-2.7.0" -Environment="GEM_PATH=/home/chatwoot/.rvm/gems/ruby-2.7.0:/home/chatwoot/.rvm/gems/ruby-2.7.0@global" \ No newline at end of file +Environment="GEM_HOME=/home/chatwoot/.rvm/gems/ruby-2.7.1" +Environment="GEM_PATH=/home/chatwoot/.rvm/gems/ruby-2.7.1:/home/chatwoot/.rvm/gems/ruby-2.7.1@global" \ No newline at end of file diff --git a/deployment/chatwoot-worker.1.service b/deployment/chatwoot-worker.1.service index b3356ba5c..8b3f0b1cb 100644 --- a/deployment/chatwoot-worker.1.service +++ b/deployment/chatwoot-worker.1.service @@ -16,10 +16,10 @@ KillMode=mixed StandardInput=null SyslogIdentifier=%p -Environment="PATH=/home/chatwoot/.rvm/gems/ruby-2.7.0/bin:/home/chatwoot/.rvm/gems/ruby-2.7.0@global/bin:/home/chatwoot/.rvm/rubies/ruby-2.7.0/bin:/home/chatwoot/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/chatwoot/.rvm/bin:/home/chatwoot/.rvm/bin" +Environment="PATH=/home/chatwoot/.rvm/gems/ruby-2.7.1/bin:/home/chatwoot/.rvm/gems/ruby-2.7.1@global/bin:/home/chatwoot/.rvm/rubies/ruby-2.7.1/bin:/home/chatwoot/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/chatwoot/.rvm/bin:/home/chatwoot/.rvm/bin" Environment="PORT=3000" Environment="RAILS_ENV=production" Environment="NODE_ENV=production" Environment="RAILS_LOG_TO_STDOUT=true" -Environment="GEM_HOME=/home/chatwoot/.rvm/gems/ruby-2.7.0" -Environment="GEM_PATH=/home/chatwoot/.rvm/gems/ruby-2.7.0:/home/chatwoot/.rvm/gems/ruby-2.7.0@global" \ No newline at end of file +Environment="GEM_HOME=/home/chatwoot/.rvm/gems/ruby-2.7.1" +Environment="GEM_PATH=/home/chatwoot/.rvm/gems/ruby-2.7.1:/home/chatwoot/.rvm/gems/ruby-2.7.1@global" \ No newline at end of file diff --git a/deployment/setup.sh b/deployment/setup.sh index 4229873c6..7c19b6b40 100644 --- a/deployment/setup.sh +++ b/deployment/setup.sh @@ -45,8 +45,8 @@ RAILS_ENV=production sudo -i -u chatwoot << EOF rvm --version rvm autolibs disable -rvm install "ruby-2.7.0" -rvm use 2.7.0 --default +rvm install "ruby-2.7.1" +rvm use 2.7.1 --default git clone https://github.com/chatwoot/chatwoot.git cd chatwoot diff --git a/docker/Dockerfile b/docker/Dockerfile index 7b41ca97f..8093fdb02 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # pre-build stage -FROM ruby:2.7.0-alpine AS pre-builder +FROM ruby:2.7.1-alpine AS pre-builder # ARG default to production settings # For development docker-compose file overrides ARGS @@ -36,7 +36,7 @@ COPY Gemfile Gemfile.lock ./ # Do not install development or test gems in production RUN if [ "$RAILS_ENV" = "production" ]; then \ - bundle install -j 4 -r 3 --without development test; \ + bundle config set without 'development test'; bundle install -j 4 -r 3; \ else bundle install -j 4 -r 3; \ fi @@ -51,7 +51,7 @@ RUN if [ "$RAILS_ENV" = "production" ]; then \ fi # final build stage -FROM ruby:2.7.0-alpine +FROM ruby:2.7.1-alpine ARG BUNDLE_WITHOUT="development:test" ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT} @@ -82,7 +82,7 @@ RUN if [ "$RAILS_ENV" = "production" ]; then \ COPY --from=pre-builder /gems/ /gems/ COPY --from=pre-builder /app /app -# Remove unecessary files +# Remove unnecessary files RUN rm -rf /gems/ruby/2.7.0/cache/*.gem \ && find /gems/ruby/2.7.0/gems/ -name "*.c" -delete \ && find /gems/ruby/2.7.0/gems/ -name "*.o" -delete diff --git a/docs/development/environment-setup/mac-os.md b/docs/development/environment-setup/mac-os.md index 9a1d456ad..d856b5b15 100644 --- a/docs/development/environment-setup/mac-os.md +++ b/docs/development/environment-setup/mac-os.md @@ -37,19 +37,19 @@ source ~/.rvm/scripts/rvm ### Install Ruby -Chatwoot APIs are built on Ruby on Rails, you need install ruby 2.7.0 +Chatwoot APIs are built on Ruby on Rails, you need install ruby 2.7.1 If you are using `rvm` : ```bash -rvm install ruby-2.7.0 -rvm use 2.7.0 +rvm install ruby-2.7.1 +rvm use 2.7.1 ``` If you are using `rbenv` to manage ruby versions do : ```bash -rbenv install 2.7.0 +rbenv install 2.7.1 ``` `rbenv` identifies the ruby version from `.ruby-version` file on the root of the project and loads it automatically. diff --git a/docs/development/environment-setup/ubuntu.md b/docs/development/environment-setup/ubuntu.md index ed062226a..3975f98e7 100644 --- a/docs/development/environment-setup/ubuntu.md +++ b/docs/development/environment-setup/ubuntu.md @@ -33,16 +33,16 @@ Enable `Run command as a login shell` in terminal `Preferences`. Restart your co ### Install Ruby -Chatwoot APIs are built on Ruby on Rails, you need install ruby 2.7.0 +Chatwoot APIs are built on Ruby on Rails, you need install ruby 2.7.1 ```bash -rvm install ruby-2.7.0 +rvm install ruby-2.7.1 ``` -Use ruby 2.7.0 as default +Use ruby 2.7.1 as default ```bash -rvm use 2.7.0 --default +rvm use 2.7.1 --default ``` ### Install Node.js diff --git a/docs/development/environment-setup/windows.md b/docs/development/environment-setup/windows.md index 144f09c36..d2b3266b6 100644 --- a/docs/development/environment-setup/windows.md +++ b/docs/development/environment-setup/windows.md @@ -26,15 +26,15 @@ sudo apt-get update sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev ``` -Install RVM & ruby version 2.7.0 +Install RVM & ruby version 2.7.1 ```bash sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB curl -sSL https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm -rvm install 2.7.0 -rvm use 2.7.0 --default +rvm install 2.7.1 +rvm use 2.7.1 --default ruby -v ```