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
classUserModelincludeVirtus.modelattribute(:first,String,default:Faker::Name.first_name)attribute(:last,String,default: Faker::Name.last_name)attribute(:email,String,default:lambda{|user,attribute| "#{user.first}.#{user.last}@devmail.company.com"})endclassOwnerModelincludeUserModelattribute(:email,String,default:lambda{|owner,attribute| "#{owner.first}.#{owner.last}@owner.company.com"})attribute(:address,String,default:'5210 Paseo de Pablo')end
However, when I do that I get an error saying: wrong argument type Class (expected Module) (TypeError). I believe this is because Virtus wants me to combine things as Modules. However, if I change both of these above to Modules and then include them in my own class, I no longer get methods like attributes on my own class.
Is there a supported way to do this kind of composing?
The text was updated successfully, but these errors were encountered:
I want to do something like this:
However, when I do that I get an error saying:
wrong argument type Class (expected Module) (TypeError)
. I believe this is because Virtus wants me to combine things as Modules. However, if I change both of these above to Modules and then include them in my own class, I no longer get methods likeattributes
on my own class.Is there a supported way to do this kind of composing?
The text was updated successfully, but these errors were encountered: