GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
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
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.
has_one :profile_data, class_name: 'profile_data' #will correctly use ProfileData
Im ok with that.
Thank you, good work. 👍
If it's ok with @jeremy i'd be happy to merge it in.
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
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.
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.
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?
@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.
Merge pull request #80 from luciancancescu/options_class_name
Options Class Name