Skip to content

Commit

Permalink
Merge pull request #2051 from tf/require-rails-7
Browse files Browse the repository at this point in the history
Require Rails 7
  • Loading branch information
tf authored Jan 12, 2024
2 parents 6300090 + 003d5f7 commit ce86a86
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 62 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/reusable-workflow-rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ jobs:
fail-fast: false
matrix:
include:
- ruby-version: 2.6
- ruby-version: 3.2
rails-version: "~> 7.1"

env:
PAGEFLOW_RAILS_VERSION: ${{ matrix.rails-version }}
PAGEFLOW_DEPENDENCIES: ${{ matrix.rails-version && 'experimental' || 'default' }}

services:
mysql:
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,13 @@ jobs:
rspec-command: bin/rspec --tag ~js
install-audiowaveform: true

- engine-name: pageflow
ruby-version: 3.2
rails-version: "~> 7.1"
engine-directory: .
rspec-command: bin/rspec --tag ~js
install-audiowaveform: true

- engine-name: pageflow
ruby-version: 3.2
engine-directory: .
rspec-command: bin/rspec-with-retry --tag js

- engine-name: pageflow
ruby-version: 3.2
rails-version: "~> 7.1"
engine-directory: .
rspec-command: bin/rspec-with-retry --tag js

- engine-name: pageflow_paged
ruby-version: 3.2
engine-directory: entry_types/paged
plugin-name: pageflow_paged
rspec-command: bin/rspec

- engine-name: pageflow_paged
ruby-version: 3.2
rails-version: "~> 7.1"
engine-directory: entry_types/paged
plugin-name: pageflow_paged
rspec-command: bin/rspec
Expand All @@ -56,29 +36,12 @@ jobs:
plugin-name: pageflow_scrolled
rspec-command: bin/rspec --tag ~js

- engine-name: pageflow_scrolled
ruby-version: 3.2
rails-version: "~> 7.1"
engine-directory: entry_types/scrolled
plugin-name: pageflow_scrolled
rspec-command: bin/rspec --tag ~js

- engine-name: pageflow_scrolled
ruby-version: 3.2
engine-directory: entry_types/scrolled
plugin-name: pageflow_scrolled
rspec-command: bin/rspec-with-retry-on-timeout --tag js

- engine-name: pageflow_scrolled
ruby-version: 3.2
rails-version: "~> 7.1"
engine-directory: entry_types/scrolled
plugin-name: pageflow_scrolled
rspec-command: bin/rspec-with-retry-on-timeout --tag js

env:
PAGEFLOW_RAILS_VERSION: ${{ matrix.rails-version }}

services:
mysql:
image: mysql:5.7
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Pageflow runs in environments with:

* Ruby >= 3.2
* Node >= 18
* Rails 6.1
* Rails 7.1
* Redis server (for Resque)
* A database server supported by Active Record (tested with MySQL)
* ImageMagick
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/pageflow/feature_target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module FeatureTarget
extend ActiveSupport::Concern

included do
serialize :features_configuration, JSON
serialize :features_configuration, coder: JSON
end

def enabled_feature_names(config = Pageflow.config_for(self))
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/pageflow/output_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module OutputSource
extend ActiveSupport::Concern

included do
serialize :output_presences, JSON
serialize :output_presences, coder: JSON
end

def present_outputs
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/pageflow/serialized_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module SerializedConfiguration
extend ActiveSupport::Concern

included do
serialize :configuration, JSON
serialize :configuration, coder: JSON
end

def configuration
Expand Down
5 changes: 4 additions & 1 deletion app/models/pageflow/entry_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ module Pageflow
class EntryTemplate < ApplicationRecord
include ThemeReferencer
include SerializedConfiguration
serialize :default_share_providers, JSON

serialize :default_share_providers, coder: JSON

belongs_to :site
delegate :enabled_feature_names, to: :site

has_many :widgets, as: :subject, dependent: :destroy

validates :site, presence: true
Expand Down
2 changes: 1 addition & 1 deletion app/models/pageflow/revision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Revision < ApplicationRecord

include ThemeReferencer

serialize :share_providers, JSON
serialize :share_providers, coder: JSON

belongs_to :entry, touch: :edited_at
belongs_to :creator, class_name: 'User', optional: true
Expand Down
4 changes: 2 additions & 2 deletions app/models/pageflow/theme_customization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module Pageflow
class ThemeCustomization < ApplicationRecord
belongs_to :site

serialize :overrides, JSON
serialize :selected_file_ids, JSON
serialize :overrides, coder: JSON
serialize :selected_file_ids, coder: JSON

has_many :uploaded_files, class_name: 'ThemeCustomizationFile'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">


<%= social_share_meta_tags_for(entry) %>
<%= meta_tags_for_entry(entry) %>
<%= feed_link_tags_for_entry(entry) unless local_assigns[:skip_feed_link_tags] %>
Expand Down
4 changes: 2 additions & 2 deletions lib/pageflow/rails_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module RailsVersion
extend self

def detect
from_env || '~> 6.1.0'
from_env || '~> 7.1.0'
end

def experimental?
detect != '~> 6.1.0'
detect != '~> 7.1.0'
end

private
Expand Down
2 changes: 1 addition & 1 deletion pageflow.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |s|

s.require_paths = ['lib', 'entry_types/paged/lib', 'entry_types/scrolled/lib']

s.add_dependency 'rails', Pageflow::RailsVersion.detect
s.add_dependency 'rails', '~> 7.1.2'

# Framework for admin interface
s.add_dependency 'activeadmin', '~> 3.0'
Expand Down
2 changes: 1 addition & 1 deletion spec/pageflow/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module Pageflow
configuration = Configuration.new
page_type = TestPageType.new(name: 'test')

ActiveSupport::Deprecation.silence do
Rails.application.deprecators.silence do
configuration.register_page_type(page_type)
end

Expand Down
6 changes: 1 addition & 5 deletions spec/support/helpers/stub_template_in_helper_specs.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
RSpec.configure do |config|
module StubTemplateTestHelper
def stub_template(hash)
if view.view_paths.respond_to?(:unshift)
view.view_paths.unshift(ActionView::FixtureResolver.new(hash))
else
view.lookup_context.prepend_view_paths([ActionView::FixtureResolver.new(hash)])
end
view.lookup_context.prepend_view_paths([ActionView::FixtureResolver.new(hash)])
end
end

Expand Down
5 changes: 4 additions & 1 deletion spec/support/pageflow/dummy/rails_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ def source_paths
# Install pageflow and the tested engine via their generators.

generate 'pageflow:install', '--force'
generate "#{ENV['PAGEFLOW_PLUGIN_ENGINE']}:install", '--force' if ENV['PAGEFLOW_PLUGIN_ENGINE']

if ENV['PAGEFLOW_PLUGIN_ENGINE'].present?
generate "#{ENV['PAGEFLOW_PLUGIN_ENGINE']}:install", '--force'
end

# Devise needs default_url_options for generating mails.

Expand Down

0 comments on commit ce86a86

Please sign in to comment.