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

Extract arel_visitor and move up to the abstract adapter #23515

Merged
merged 1 commit into from Apr 19, 2016

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Feb 6, 2016

No description provided.

@rails-bot
Copy link

r? @rafaelfranca

(@rails-bot has picked a reviewer for you, use r? to override)

@@ -143,6 +149,10 @@ def collector
end
end

def arel_visitor # :nodoc:
(Arel::Visitors::VISITORS[@config[:adapter]] || Arel::Visitors::ToSql).new(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why fallback to Arel::Visitors::ToSql?
I think it is better to override this method if someone create an adapter that Arel does not support.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, thanks !

@jeremy jeremy merged commit 8200b3b into rails:master Apr 19, 2016
jeremy added a commit that referenced this pull request Apr 19, 2016
Extract `arel_visitor` and move up to the abstract adapter
@kamipo kamipo deleted the extract_arel_visitor branch April 19, 2016 07:51
@jonatack
Copy link
Contributor

Is this a permanent change? It breaks Ransack's Active Record adapter: uninitialized constant Arel::Visitors::VISITORS. Thanks :)

@kamipo
Copy link
Member Author

kamipo commented Apr 19, 2016

hmm... Arel::Visitors::VISITORS was removed on arel master by rails/arel#412...

@kamipo
Copy link
Member Author

kamipo commented Apr 19, 2016

Fixed by #24634.

yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Jun 7, 2016
kamipo added a commit that referenced this pull request Jan 15, 2019
…sage

This attr writer was introduced at 7db90aa, but the usage is already
removed at bd2f5c0 before v3.2.0.rc1 is released.

If we'd like to customize the visitor in the connection, `arel_visitor`
which is implemented in all adapters (mysql2, postgresql, sqlite3,
oracle-enhanced, sqlserver) could be used for the purpose #23515.
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.

None yet

7 participants