ActiveModel check account type on references
I have a Rails 4 app which has a user model that belongs to an :account
through a polymorphic relations ship. When the User model is initialized i
created a custom method to automatically set the User to be a developer
but if i want the user to be an organization i have to disregard that
before_create filter.
I tried something like
before_create :create_developer, unless: self.account_type.eql?(Organization)
but i had no luck, any suggestions on how to achieve this?
No comments:
Post a Comment