You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if it's possible to specify the join table name to use for a hasMany association? I would like to keep my SQL structure and test data from the application, but in some instances it's not possible in hasMany relations. My table names use underscores as well as my properties.
If for example I want to have a table role and a table app_module, linked by role_app_module, it doesn't work with hasMany. Is this possible to have a solution for this?
It compiles (but wouldn't without the third empty argument) but when I call role.getApp_modules, it says the method doesn't exist. I also tried getApp_modules. Maybe underscores break how getters and setters are generated?
Has this commit been merged to the master branch? I updated ORM twice recently (now at 2.1.0) and I had to manually apply this commit after both updates
I don't believe the latest changes have made it into a release yet. We'll have to check with @dresende, but we'll likely only have a release when #288, #293 and a few others have been merged, tested and deemed stable.
Yes, there are a few pending issues that we have to close. The next release will surely have this merged already. And will be released as soon as we close those issues.
Activity
notheotherben commentedon Aug 2, 2013
You should be able to set the
merge_tableproperty when defining your hasMany relationship.SamuelBolduc commentedon Aug 2, 2013
Thanks for the reply? I did this :
It compiles (but wouldn't without the third empty argument) but when I call role.getApp_modules, it says the method doesn't exist. I also tried getApp_modules. Maybe underscores break how getters and setters are generated?
dresende commentedon Aug 3, 2013
Documentation needs to be added for this, but for now here's more options you can use in the association:
If you don't set this options, it will create them based on the app_module.
@spartan563 probably a good addition would be to have another key like
accessor: "AppModules"that would be the template for get/set/...notheotherben commentedon Aug 3, 2013
Sounds like a good idea to me, I'll see about getting it added and tested sometime today.
notheotherben commentedon Aug 3, 2013
I'll also add a
reverseAccessorproperty so it's possible to set the template for reversed accessors.Allow accessor template to be set (dresende#276)
dresende commentedon Aug 3, 2013
👍
SamuelBolduc commentedon Aug 6, 2013
Thank you very much for this! It was exactly what I needed. Also, SPARTAN563's addition worked very well for me!
I think it would be a good addition to the docs!
SamuelBolduc commentedon Aug 13, 2013
Has this commit been merged to the master branch? I updated ORM twice recently (now at 2.1.0) and I had to manually apply this commit after both updates
notheotherben commentedon Aug 13, 2013
I don't believe the latest changes have made it into a release yet. We'll have to check with @dresende, but we'll likely only have a release when #288, #293 and a few others have been merged, tested and deemed stable.
dresende commentedon Aug 13, 2013
Yes, there are a few pending issues that we have to close. The next release will surely have this merged already. And will be released as soon as we close those issues.
SamuelBolduc commentedon Aug 13, 2013
Cool, thank you!