-
Notifications
You must be signed in to change notification settings - Fork 179
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
support has_many in YAML sources #94
Comments
I'll close this because long time is passed. If you need this again, please reopen. |
Non-collaborators can't reopen. |
@Nowaker Oh, sorry. I've reopened! |
FWIW - Not yet using ActiveHash, but probably will be by the end of today... This would be very cool for something related to the use case that led me looking for a static activemodel solution. (Very limited number of records, data is effectively read-only, the column structure changes probably more often than the recordset) In fact, we're already seeding config data into ActiveRecord for another part of the system via two-tier YAML much like OP presents, that might be easier to manage if in ActiveHash - in that case, there are two different sub-configuration-record types. So as a newcomer, put this down as a vote for 'cool thing to add somewhere down the line maybe' |
This would be extremely helpful. I'm trying a similar case, where I have two class PermissionGroupTemplate < ActiveYaml::Base
...
has_many :permission_templates
...
end class PermissionTemplate < ActiveYaml::Base
...
belongs_to :permission_template_group
...
end Hence those examples, an structure like this in the yaml files would be interesting: # permission_group_templates.yml
- id: 1
permission_template_ids: [1] # permission_templates.yml
- id: 1
permission_group_template_id: 1 idk if the current implementation could support something like that, but it would be useful EDIT After a bit tinkering, this actually works :) |
I'm surprised you need the For my own future reference would you please share with us:
|
@kbrock as I tested:
Also, I didn't tinker with aliases or shortcuts, and so far I don't know how they could work in this case. Don't you thing this use case should be explicit in the documentation? |
This could understand nested structures and create
IsoImage
objects too, along with an appropriate relation.The text was updated successfully, but these errors were encountered: