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

Add plural to Brainstem::DSL::Association #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

naomiajacobs
Copy link

@naomiajacobs naomiajacobs commented Nov 9, 2017

Part of the effort in: https://github.com/mavenlink/mavenlink/pull/10271

This PR adds a key to the association object called plural that is set on initialization. If a plural option is passed in, it defaults to that, otherwise it tries to figure out whether the association is plural or not by seeing if it can be singularized. This option can be used to find out whether an association is plural, and allows for an override in case it's not easily guessable from the name of the association.

@naomiajacobs naomiajacobs self-assigned this Nov 9, 2017
@naomiajacobs naomiajacobs requested a review from bennapp November 9, 2017 16:17
@naomiajacobs naomiajacobs changed the title Spike - add support for dynamic associations Add plural to Brainstem::DSL::Association Nov 9, 2017
@naomiajacobs
Copy link
Author

@bennapp can you review please?


context 'when `plural` is not specified in the options' do
it 'delegates to ruby singularize and pluralize to guess if the association is plural or singular' do
class Dress
Copy link
Contributor

Choose a reason for hiding this comment

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

👗

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

Successfully merging this pull request may close these issues.

2 participants