Skip to content
This repository was archived by the owner on Jan 11, 2020. It is now read-only.

Support class_name specified with a class, not a string#4

Open
steverice wants to merge 1 commit into
PagerDuty:masterfrom
steverice:support-real-classes
Open

Support class_name specified with a class, not a string#4
steverice wants to merge 1 commit into
PagerDuty:masterfrom
steverice:support-real-classes

Conversation

@steverice
Copy link
Copy Markdown
Contributor

It's completely valid in ActiveRecord to specify the class_name as an actual class reference, so ManyToMany should support it as well.

http://guides.rubyonrails.org/association_basics.html#options-for-belongs-to-class-name

@steverice steverice force-pushed the support-real-classes branch from bb6b2cb to d6c6054 Compare November 1, 2016 19:00
It's completely valid in ActiveRecord to specify the `class_name` as an actual class reference, so `ManyToMany` should support it as well.

http://guides.rubyonrails.org/association_basics.html#options-for-belongs-to-class-name
@steverice steverice force-pushed the support-real-classes branch from d6c6054 to 2409623 Compare November 1, 2016 19:50
has_many :simple_belongs_tos
has_many :belongs_to_throughs, through: :simple_belongs_tos
has_many :class_nameds, class_name: 'ManyToManyTest::SomeClassName'
has_many :class_nameds_by_class, class_name: ManyToManyTest::SomeClassNamedByClass
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this needs to be changed to class_named_by_classs? Pretend you're a snake!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants