-
Notifications
You must be signed in to change notification settings - Fork 325
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
Associations: use class association path instead of association name #425
Comments
Hiya. Can't you do that by specifying the class?
has_many :bank_accounts, classname: 'RemoteBankAccount'
Unless I have misunderstood?
Ed
…--
Sent from my phone: please forgive the brevity.
Ed Jones
On 26 Dec 2016, at 10:54, Nicolas Besnard ***@***.***> wrote:
In the following case:
class RemoteBankAccount
collection_path 'bankaccounts'
end
class RemoteUser
has_many :bank_accounts
end
I could be nice to use collection_path instead of the association name.
If you are ok, I can do the PR :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
When I specify the class, it doesn't use the As you can see on the here, the association name is used to find the path |
Hi @nicolas-besnard OK I understand. Makes sense to parameterise that I guess. A PR would be welcome :) |
I think changing this will break people code. We should use an options for this. What do you thing ? Should it be the default behavior ? |
I think it should be parameterised / optional @nicolas-besnard . You want to take a swing at a PR and we'll see how we go? Thanks loads for being involved :-) |
+1 on using In the meantime here's a workaround: class RemoteBankAccount
collection_path 'bankaccounts'
end
class RemoteUser
has_many :bank_accounts, path: "/bankaccounts"
end |
In the following case:
I could be nice to use
collection_path
instead of the association name.If you are ok, I can do the PR :)
The text was updated successfully, but these errors were encountered: