Open xlts opened 7 years ago
I think you need to create a WashOut::Type
class, this is how I map mine:
class Soap::Account < WashOut::Type
map name: :string,
balance: :double,
minimum_balance: :double,
currency: :string
end
@jdsampayo as I said, creating a container-like class such as the one you proposed works fine. However I'd prefer to be able to configure an existing ActiveRecord
model rather than duplicate code by having to define separate classes for all models.
I'm unable to change SOAP ComplexType fields for ActiveRecord models and I'm always stuck with the model's DB columns including
created_at
and possibly other unwanted fields, like in this WSDL excerpt:What I want to do is to define new fields and/or get rid of others. Obviously I tried
but it results in
undefined method 'map' for #<Class:0x00000005bada60>
. Of course, makingMyModel
extend fromWashOut::Type
works fine but I want to keep instances ofMyModel
ActiveRecord objects. Is there any way to deal with it other than writing another class (extending fromWashOut::Type
) which would serve as a container aroundMyModel
? Am I missing a module which I can include into an ActiveRecord class?