Skip to content

Conversation

tomash
Copy link
Collaborator

@tomash tomash commented Dec 15, 2016

has_one and has_many macros now honor foreign_key option, if the foreign key name should be different than guessed from class name.

We've stumbled upon this when building a set of Repository classes for existing Mongoid models, which meant we had both DealRepository and Deal classes, the foreign key for them used in child classes is always deal_id, never deal_repository_id.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 98.84% when pulling 123bdd6 on rebased:association-foreign-keys into d5105ad on efreesen:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 98.84% when pulling 123bdd6 on rebased:association-foreign-keys into d5105ad on efreesen:master.

Copy link
Owner

@efreesen efreesen left a comment

Choose a reason for hiding this comment

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

Great

@efreesen efreesen merged commit 729f572 into efreesen:master Dec 15, 2016
@efreesen
Copy link
Owner

Pushed version 0.5.1 to rubygems.

Thank you.

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.

3 participants