Skip to content
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

How should records, methods be added or code injected into -Entries class? #11

Open
siers opened this issue Jun 25, 2018 · 1 comment
Open

Comments

@siers
Copy link

siers commented Jun 25, 2018

In the spirit of #3, I'm wondering how I could add the ActiveStorage accessors for has_many_attached?

In the #3 it was said that you could add a belongs_to to the model, but in this case the accessors and relations should really be added to the parent.

Wouldn't it make more sense to create a real, generated model inside app/models, since that would also make autoloading work as expected (i.e. I don't have to load Article to instantiate ArticleDetailsEntry or similar)

@siers
Copy link
Author

siers commented Jun 25, 2018

So perhaps it should just be just ArticleDetailsEntry.class_exec do has_many_attached :files end after instantiating Article? :) If so, this issue might serve as documentation.

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

No branches or pull requests

1 participant