diff --git a/Gemfile.lock b/Gemfile.lock index 16fdd7c2e..7ac1ca201 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -365,7 +365,7 @@ DEPENDENCIES capistrano-rails capybara childprocess - chrono_model (<= 0.12.1) + chrono_model cucumber database_cleaner factory_bot_rails diff --git a/backend/Gemfile b/backend/Gemfile index 9f9f2483b..bee7c6049 100644 --- a/backend/Gemfile +++ b/backend/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' gem 'active_model_serializers' gem 'arel' gem 'cancancan' -gem 'chrono_model', '<= 0.12.1' +gem 'chrono_model' gem 'geocoder' gem 'globalize', git: 'https://github.com/globalize/globalize' gem 'globalize-accessors' diff --git a/backend/Gemfile.lock b/backend/Gemfile.lock index 9a80cf893..a6f84ddb1 100644 --- a/backend/Gemfile.lock +++ b/backend/Gemfile.lock @@ -86,8 +86,8 @@ GEM case_transform (0.2) activesupport choice (0.2.0) - chrono_model (0.12.1) - activerecord (>= 4.2.0, < 5.2.0) + chrono_model (1.2.2) + activerecord (>= 5.0.0) multi_json pg coderay (1.1.2) @@ -356,7 +356,7 @@ DEPENDENCIES capistrano capistrano-db-tasks! capistrano-rails - chrono_model (<= 0.12.1) + chrono_model factory_bot_rails geocoder globalize! diff --git a/backend/db/seeds.rb b/backend/db/seeds.rb index b4a3737e0..3b23a1289 100644 --- a/backend/db/seeds.rb +++ b/backend/db/seeds.rb @@ -7,6 +7,13 @@ # Character.create(name: 'Luke', movie: movies.first) # avoid after_commit error when creating broadcasts + +# to make amend_period! available +require 'chrono_model/utilities' +ActiveRecord::Base.instance_eval do + extend ChronoModel::Utilities +end + Scenic.database.refresh_materialized_view(:statistic_broadcasts, cascade: false) tv = Medium.create!(id: 0, name_de: 'TV', name_en: 'TV') diff --git a/backend/spec/rails_helper.rb b/backend/spec/rails_helper.rb index c4a9d0d52..8cc89d0b7 100644 --- a/backend/spec/rails_helper.rb +++ b/backend/spec/rails_helper.rb @@ -9,6 +9,12 @@ require 'rspec/rails' require 'vcr' require 'json_matchers/rspec' +# to make amend_period! available +require 'chrono_model/utilities' +ActiveRecord::Base.instance_eval do + extend ChronoModel::Utilities +end + # Add additional requires below this line. Rails is not loaded until this point! # Requires supporting ruby files with custom matchers and macros, etc, in