Skip to content

Replace order strings with symbols/arel_table.#37

Closed
gmacdougall wants to merge 1 commit into
solidusio:masterfrom
gmacdougall:association_order_symbols
Closed

Replace order strings with symbols/arel_table.#37
gmacdougall wants to merge 1 commit into
solidusio:masterfrom
gmacdougall:association_order_symbols

Conversation

@gmacdougall

Copy link
Copy Markdown
Member

There are some issues that some users can encounter to to a lack of
specific naming due to SQL errors on ordering. If the scope has
something like .order('name') it may cause a SQL error when we join
with another table that also has a name column.

As part of this, I got rid of a couple of generally terrible tests which
rely VERY heavily on their specific implementation.

There are some issues that some users can encounter to to a lack of
specific naming due to SQL errors on ordering. If the scope has
something like `.order('name')` it may cause a SQL error when we join
with another table that also has a name column.

As part of this, I got rid of a couple of generally terrible tests which
rely VERY heavily on their specific implementation.
@jhawthorn

Copy link
Copy Markdown
Contributor

👍

1 similar comment
@seantaylor

Copy link
Copy Markdown

👍

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm a bit confused by this in that it removes the table name specificity, which seems at face value to be contradictory to the PR description. Can you help me understand?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

By using the symbol instead of a string, ActiveRecord does the work for you. It quotes the table name, and column name using the appropriate syntax for the the current DBMS.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

@magnusvk

Copy link
Copy Markdown
Contributor

@gmacdougall Is this still something we'd want to merge? Or should we close this out? As far as I'm concerned, we probably should, right?

@jordan-brough

Copy link
Copy Markdown
Contributor

@jhawthorn mentioned to me yesterday that this was on his todo list. or at least his wish list.

@gmacdougall

Copy link
Copy Markdown
Member Author

This is one of those things that I keep meaning to finish up, but keep getting distracted.

@BenMorganIO

Copy link
Copy Markdown
Contributor

@gmacdougall Maybe make a part 1, part 2, part n?

I'll be stealing some of the concepts here for #289...

@gmacdougall

Copy link
Copy Markdown
Member Author

The symbol changes should be good after a rebase. The only thing missing is that I removed some really terrible tests rather than re-writing them to not be terrible. The tests would provide value if they weren't awful so I just need to sit down and write a few good tests...

@jhawthorn

Copy link
Copy Markdown
Contributor

Merged as #298

@jhawthorn jhawthorn closed this Aug 19, 2015
@BenMorganIO

Copy link
Copy Markdown
Contributor

👍

wuboy0307 added a commit to wuboy0307/spree that referenced this pull request Jan 22, 2016
wuboy0307 added a commit to wuboy0307/spree that referenced this pull request Jan 22, 2016
wuboy0307 added a commit to wuboy0307/spree that referenced this pull request Jan 23, 2016
waiting-for-dev added a commit that referenced this pull request Nov 3, 2022
We're grouping changes by the solidus component they belong to. E.g. (PR
numbers and full changelog range would be linkable):

---
What's Changed

Solidus Core
- Fix bug by @waiting-for-dev in #36
- Add cool feature by @waiting-for-dev in #37

Solidus Admin
- Make something compatible by @waiting-for-dev in #35

Solidus API
- Add endpoint by @waiting-for-dev in #34

Full Changelog: v3.2.0...v3.3.0
---

That configuration makes the release notes follow the same schema that
we're using in the Changelog file [1]. Unfortunately, it's not possible
to change the release or PR templates to make them identical.

[1] - https://github.com/solidusio/solidus/blob/master/CHANGELOG.md
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.

7 participants