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

Delegate to_sentence and to_fomatted_s to records #27904

Conversation

kenta-s
Copy link
Contributor

@kenta-s kenta-s commented Feb 4, 2017

Fix: #27901

@rails-bot
Copy link

r? @matthewd

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

@@ -37,7 +37,7 @@ def inherited(child_class)
# for each different klass, and the delegations are compiled into that subclass only.

delegate :to_xml, :encode_with, :length, :collect, :map, :each, :all?, :include?, :to_ary, :join,
:[], :&, :|, :+, :-, :sample, :reverse, :compact, :in_groups, :in_groups_of,
:[], :&, :|, :+, :-, :sample, :reverse, :compact, :in_groups, :in_groups_of, :to_sentence, :to_formatted_s, :to_xml,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe wrap to next line?

@kenta-s kenta-s force-pushed the add-methods-back-to-array-delegation-from-ar-relation branch 2 times, most recently from bc7cf95 to 5aa368b Compare February 4, 2017 13:58
@kenta-s
Copy link
Contributor Author

kenta-s commented Feb 4, 2017

@simi Thank you. And I mistakenly added to_xml twice(which was working correctly) so I removed it.

@kenta-s kenta-s changed the title Delegate to_sentence, to_fomatted_s and to_xml to records Delegate to_sentence and to_fomatted_s to records Feb 4, 2017
@maclover7
Copy link
Contributor

@kenta-s Can you add a test to confirm the new behavior? Thanks!

@simi
Copy link
Contributor

simi commented Feb 4, 2017

Should be enough to add new delegations to this array in test suite.

@kenta-s kenta-s force-pushed the add-methods-back-to-array-delegation-from-ar-relation branch from 5aa368b to 5d50962 Compare February 4, 2017 14:20
@kenta-s
Copy link
Contributor Author

kenta-s commented Feb 4, 2017

done :)

@eileencodes eileencodes merged commit dd74cd3 into rails:master Feb 10, 2017
eileencodes added a commit that referenced this pull request Feb 10, 2017
…gation-from-ar-relation

Delegate `to_sentence` and `to_fomatted_s` to `records`
@eileencodes
Copy link
Member

Backported to 5-0-stable in 28a1bdd

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