-
Notifications
You must be signed in to change notification settings - Fork 79
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
Defining configuration outside of the ActiveRecord model #101
Comments
No. Interesting idea. May I ask why would you do so? You could do by monkey patching module Simple
def self.included(m)
m.comma :simple do
name
desrciption
end
end
end
module DynamicCommaDefinition
def to_comma(style = :default)
self.class.include(style.to_s.constantize)
ensure
super
end
end
Object.prepend(DynamicCommaDefinition) |
The purpose would be to keep the active record model class lean. It's a On Tue, Jun 28, 2016 at 6:20 PM, Eito Katagiri notifications@github.com
|
I see. Thank you. |
Does comma have pre-existing support for defining the comma config outside of the ActiveRecord model? For instance, is there an easy way to create an
app/serializers
folder for this config? I'd prefer to keep it separate if possible, and want to avoid using aninclude
if there's already a way to do this.Thanks!
The text was updated successfully, but these errors were encountered: