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

Don't rely on the sql type to quote XML columns in PG #16072

Merged
merged 1 commit into from
Jul 8, 2014

Conversation

sgrif
Copy link
Contributor

@sgrif sgrif commented Jul 6, 2014

No description provided.

@value = value
end

def to_s
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is Data class needed instead of just doing value.to_s if value in the type_cast_for_database method, and checking for Xml instead of Xml::Data elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the database adapter can use special quoting without peeking inside the column object. This is the same pattern we use with binary.

rafaelfranca added a commit that referenced this pull request Jul 8, 2014
Don't rely on the sql type to quote XML columns in PG
@rafaelfranca rafaelfranca merged commit 336be2b into rails:master Jul 8, 2014
carlosantoniodasilva added a commit that referenced this pull request Aug 5, 2014
The method has been removed in 0920671
(PR #16074), but the delegation was apparently missed, and one instance
of the method was added back with the addition of OID::Xml in
336be2b (PR #16072), so we can safely
rm both.
@sgrif sgrif deleted the sg-xml-quoting branch March 14, 2018 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants