-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure the dummy app uses the same template as real apps. #3180
Open
parndt
wants to merge
8
commits into
main
Choose a base branch
from
feature/consistent-dummy-app
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5bb2fb5
Ensure the dummy app uses the same template as real apps.
parndt 4301b12
Remove assets.compile = true
parndt 073ca64
Opt in to fewer than rails/all
parndt 2e8a1c3
Ignore load_error variable
parndt fe79c2d
The dummy generator fails without activejob 🐊
parndt b187ee2
yes to all generator questions
parndt 249cd9e
Rename skip_migrate to skip_migrations
bricesanchez c3cac10
Add skip-seeds arg to Refinery::CmsGenerator
bricesanchez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,3 +98,6 @@ Gemfile.lock | |
|
||
# rspec failures | ||
.rspec_failures | ||
|
||
db/ | ||
config/initializers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
core/lib/generators/refinery/dummy/templates/rails/application.rb.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Check that Rails application configuration is consistent with what we expect. | ||
require 'pathname' | ||
|
||
module Refinery | ||
module Core | ||
class EnvironmentChecker | ||
|
||
def initialize(root_path, environments: %w(development test production)) | ||
@root_path = Pathname.new(root_path) | ||
@environments = environments | ||
end | ||
|
||
def call | ||
environment_files.each do |env_file| | ||
# Refinery does not necessarily expect action_mailer to be available as | ||
# we may not always require it (currently only the authentication extension). | ||
# Rails, however, will optimistically place config entries for action_mailer. | ||
current_mailer_config = mailer_config(env_file) | ||
|
||
if current_mailer_config.present? | ||
new_mailer_config = [ | ||
" if config.respond_to?(:action_mailer)", | ||
current_mailer_config.gsub(%r{\A\n+?}, ''). # remove extraneous newlines at the start | ||
gsub(%r{^\ \ }) { |line| " #{line}" }, # add indentation on each line | ||
" end" | ||
].join("\n") | ||
|
||
env_file.write( | ||
env_file.read.gsub(current_mailer_config, new_mailer_config) | ||
) | ||
end | ||
end | ||
end | ||
|
||
private | ||
attr_reader :environments, :root_path | ||
|
||
def environment_files | ||
environments.map { |env| root_path.join("config", "environments", "#{env}.rb") } | ||
.select(&:file?) | ||
end | ||
|
||
def mailer_config(environment_file) | ||
root_path.join(environment_file).read.match( | ||
%r{^\s.+?config\.action_mailer\..+([\w\W]*\})?} | ||
).to_a.flatten.first | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ def change | |
t.string :image_uid | ||
t.string :image_ext | ||
|
||
t.timestamps | ||
t.timestamps null: false | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ def change | |
t.string :file_uid | ||
t.string :file_ext | ||
|
||
t.timestamps | ||
t.timestamps null: false | ||
end | ||
end | ||
end |
5 changes: 3 additions & 2 deletions
5
resources/lib/generators/refinery/resources/resources_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mailer stuff should be done by refinerycms-inquiries. The core doesn't send mail.
Maybe this whole thing shouldn't even be our concern?