ActiveModel::Name does not inherit from string #5593

Merged
merged 1 commit into from Mar 26, 2012

Conversation

Projects
None yet
6 participants
Contributor

lukesarnacki commented Mar 26, 2012

Like in ActiveModel::Errors we should favor composition over inheritance

tenderlove added a commit that referenced this pull request Mar 26, 2012

Merge pull request #5593 from lukesarnacki/activemodel_name_compositi…
…on_over_inheritance

ActiveModel::Name does not inherit from string

@tenderlove tenderlove merged commit e8b5c8e into rails:master Mar 26, 2012

Do you know where these are being used? Eventually I'd like to get rid of the delegate methods.

Contributor

lukesarnacki commented Mar 26, 2012

It made it for convenience, because it may be common to compare model name with a String. And without to_str test that was comparing "Anonynous" == model_name was failing.

Contributor

evanphx commented Mar 26, 2012

Where should I send the $100?

Member

steveklabnik commented Mar 26, 2012

Just for comparison, I was racing with this: steveklabnik/rails@8f6a4b8

Contributor

jmazzi commented Mar 26, 2012

@steveklabnik @lukesarnacki this is what I had jmazzi/rails@0d85690.

@lukesarnacki removed the failing test I was trying to fix.

Contributor

lukesarnacki commented Mar 26, 2012

@jmazzi I changed only test that asserts ActiveModel::Naming is a String. Not removed anything.

Contributor

jmazzi commented Mar 26, 2012

I wasn't trying to imply the change you made was wrong. It was the proper change. I should have done the same.

Contributor

lukesarnacki commented Mar 26, 2012

@jmazzi :)

Contributor

rkh commented Mar 26, 2012

Contributor

jmazzi commented Mar 26, 2012

class Rkh < :trollface:
end

Owner

tenderlove commented Mar 26, 2012

Yet another reason I wish that :trollface: was a real unicode character.

Contributor

jmazzi commented Mar 26, 2012

@tenderlove open an emergency feature request ticket for Ruby 2.0

Contributor

rkh commented Mar 26, 2012

@tenderlove U+1F479 and U+1F47A come pretty close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment