Skip to content

Commit

Permalink
Merge pull request #647 from mislav/fix-ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
mislav committed May 29, 2023
2 parents 8aa3a87 + 8039e7d commit 637b9fc
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
3 changes: 3 additions & 0 deletions environments/Gemfile.rails5.0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@

gem 'mysql2', '~> 0.5.2', :group => :mysql
gem 'pg', '~> 1.2.3', :group => :pg

# ruby 2.4 compat re: nokogiri
gem 'loofah', '< 2.21.0'
3 changes: 3 additions & 0 deletions environments/Gemfile.rails5.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@

gem 'mysql2', '~> 0.5.2', :group => :mysql
gem 'pg', '~> 1.2.3', :group => :pg

# ruby 2.4 compat re: nokogiri
gem 'loofah', '< 2.21.0'
3 changes: 3 additions & 0 deletions environments/Gemfile.rails5.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
gem 'sqlite3', '~> 1.3.6'
gem 'mysql2', '~> 0.5.2', :group => :mysql
gem 'pg', '~> 1.2.3', :group => :pg

# ruby 2.4 compat re: nokogiri
gem 'loofah', '< 2.21.0'
5 changes: 5 additions & 0 deletions spec/finders/activerecord_test_connector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
require 'date'
require 'yaml'

# forward compatibility with Rails 7 (needed for time expressions within fixtures)
class Time
alias_method :to_fs, :to_s
end unless Time.new.respond_to?(:to_fs)

# monkeypatch needed for Ruby 3.1 & Rails 6.0
YAML.module_eval do
class << self
Expand Down
10 changes: 5 additions & 5 deletions spec/fixtures/replies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ witty_retort:
id: 1
topic_id: 1
content: Birdman is better!
created_at: <%= 6.hours.ago.utc.to_s(:db) %>
created_at: <%= 6.hours.ago.utc.to_fs(:db) %>

another:
id: 2
topic_id: 2
content: Nuh uh!
created_at: <%= 1.hour.ago.utc.to_s(:db) %>
created_at: <%= 1.hour.ago.utc.to_fs(:db) %>

spam:
id: 3
topic_id: 1
content: Nice site!
created_at: <%= 1.hour.ago.utc.to_s(:db) %>
created_at: <%= 1.hour.ago.utc.to_fs(:db) %>

decisive:
id: 4
topic_id: 4
content: "I'm getting to the bottom of this"
created_at: <%= 30.minutes.ago.utc.to_s(:db) %>
created_at: <%= 30.minutes.ago.utc.to_fs(:db) %>

brave:
id: 5
topic_id: 4
content: "AR doesn't scare me a bit"
created_at: <%= 10.minutes.ago.utc.to_s(:db) %>
created_at: <%= 10.minutes.ago.utc.to_fs(:db) %>
8 changes: 4 additions & 4 deletions spec/fixtures/topics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ futurama:
title: Isnt futurama awesome?
subtitle: It really is, isnt it.
content: I like futurama
created_at: <%= 1.day.ago.utc.to_s(:db) %>
created_at: <%= 1.day.ago.utc.to_fs(:db) %>
updated_at:

harvey_birdman:
id: 2
title: Harvey Birdman is the king of all men
subtitle: yup
content: He really is
created_at: <%= 2.hours.ago.utc.to_s(:db) %>
created_at: <%= 2.hours.ago.utc.to_fs(:db) %>
updated_at:

rails:
Expand All @@ -20,11 +20,11 @@ rails:
title: Rails is nice
subtitle: It makes me happy
content: except when I have to hack internals to fix pagination. even then really.
created_at: <%= 20.minutes.ago.utc.to_s(:db) %>
created_at: <%= 20.minutes.ago.utc.to_fs(:db) %>

ar:
id: 4
project_id: 1
title: ActiveRecord sometimes freaks me out
content: "I mean, what's the deal with eager loading?"
created_at: <%= 15.minutes.ago.utc.to_s(:db) %>
created_at: <%= 15.minutes.ago.utc.to_fs(:db) %>
6 changes: 5 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ def have_deprecation(msg)
end

def ignore_deprecation
ActiveSupport::Deprecation.silence { yield }
if ActiveSupport::Deprecation.respond_to?(:silence)
ActiveSupport::Deprecation.silence { yield }
else
yield
end
end
}

Expand Down

0 comments on commit 637b9fc

Please sign in to comment.