Skip to content
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

Implement custom views path #298

Closed

Conversation

DNA
Copy link

@DNA DNA commented Apr 28, 2020

Hi there!

Here at work we use two database adapters, SQL Server and SQLite (for quick tests before CI/CD). Since some syntax between those two are incompatible, we need to have two SQL files, and those can't live in the same directory.

The best solution we found was to add a configuration attribute to define the views path directory, so we can edit it inside Rails like that:

adapter = Rails.env.test? ? 'sqlite' : 'sqlserver'

Scenic.configure do |config|
  config.views_path = "db/views/#{adapter}"
end

Since more people could benefit from this change, I've decided to open a PR.
Let me know if it's is OK or if I missed something 😃

Implement a configuration attribute the user can edit to change the
default path where the view SQL files are generated
@derekprior derekprior changed the base branch from master to main June 18, 2020 15:03
@derekprior
Copy link
Contributor

We have a number of proposed changes (see: view-paths ) that cover this same functionality. I think #237 is closest to something we would consider merging in that covers multiple use cases. Swapping one static path for another would solve some problems but create others.

@derekprior derekprior closed this Dec 15, 2021
@DNA DNA deleted the feature/add-configurable-view-path branch December 20, 2021 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants