Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Options Class Name #80

Merged
merged 1 commit into from Nov 30, 2015

Conversation

Projects
None yet
9 participants

The class name set in options[:class_name] is currently changed to singular (by .classify).

Example with the problem:

has_one :profile_data, class_name: 'profile_data' 

gives the following error:

NameError: uninitialized constant ProfileDatum

I expect it to use ProfileData if that is what I specify in options[:class_name]. In this commit, if the options[:class_name] is set then that class is used, otherwise it defaults to name.to_s.classify.

So:

has_one :profile_data, class_name: 'profile_data' #will correctly use ProfileData

redmar commented Jul 3, 2013

👍

benoist commented Jul 5, 2013

+1

Collaborator

SweeD commented Jul 5, 2013

Im ok with that.
Thank you, good work. 👍

If it's ok with @jeremy i'd be happy to merge it in.

Owner

rafaelfranca commented Jul 5, 2013

This will introduce a non backward compatible change. People can expect it to always use the singular form and now it will not. If we are going to merge this one it can't be in the 4.0.x release and should have to be added to the CHANGELOG

Member

sikachu commented Jul 10, 2013

It seems like the CHANGELOG is wrong, as it says options[:name] and not :class_name option? Am I missing something here?

@sikachu thanks for the comment, I fixed it.

Owner

guilleiguaran commented Jul 15, 2013

We will need to create a 4-0-stable branch before of merge this

Any updates? It's been 3 months already and no reaction.

Owner

jeremy commented Sep 27, 2013

Please squash the commits into one. @guilleiguaran, could you branch 4-0-stable and merge this to master?

use the class name in options
update the CHANGELOG with version 4.1

correct name to class_name in CHANGELOG

@jeremy @guilleiguaran done, see the commit above.

Just tripped over this. What's the status?

@bdewater bdewater referenced this pull request in gemnasium/toolbelt Sep 18, 2014

Closed

Freeze version for certain gems for autoupdate #17

Collaborator

SweeD commented Nov 3, 2014

@luciancancescu The stable-4.0 branch exist now and the commit looks good to me.

If you'll be so kind to rebase it to master again, I'm happy to merge it.

Thanks ❤️

@rafaelfranca rafaelfranca merged commit 15003fe into rails:master Nov 30, 2015

rafaelfranca added a commit that referenced this pull request Nov 30, 2015

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