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

ActiveModel::Name does not inherit from string #5593

Conversation

lukesarnacki
Copy link
Contributor

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

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

ActiveModel::Name does not inherit from string
@tenderlove tenderlove merged commit e8b5c8e into rails:master Mar 26, 2012
@lukesarnacki
Copy link
Contributor Author

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.

@evanphx
Copy link
Contributor

evanphx commented Mar 26, 2012

Where should I send the $100?

@steveklabnik
Copy link
Member

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

@jmazzi
Copy link
Contributor

jmazzi commented Mar 26, 2012

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

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

@lukesarnacki
Copy link
Contributor Author

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

@jmazzi
Copy link
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.

@lukesarnacki
Copy link
Contributor Author

@jmazzi :)

@rkh
Copy link
Contributor

rkh commented Mar 26, 2012

@steveklabnik @lukesarnacki @jmazzi here is my approach: rkh@d8ced12

@jmazzi
Copy link
Contributor

jmazzi commented Mar 26, 2012

class Rkh < :trollface:
end

@tenderlove
Copy link
Member

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

@jmazzi
Copy link
Contributor

jmazzi commented Mar 26, 2012

@tenderlove open an emergency feature request ticket for Ruby 2.0

@rkh
Copy link
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants