Joerg,
Try this:
ActionWebService::API::Base.allow_active_record_expects = true
The reason for the option is in the CHANGELOG for ActionWebService:
Add ActionWebService::API::Base.allow_active_record_expects option,
with a default of false. Setting this to true will allow specifying
ActiveRecord::Base model classes in :expects. API writers should take
care to validate the received ActiveRecord model objects when turning
it on, and/or have an authentication mechanism in place to reduce the
security risk.
Cody
On 1/20/06, Joerg Diekmann <joergd@pobox.com>
wrote:> Hi,
>
> I have a webservice. And I want to pass in, a model.
> So, for example:
>
> api_method :save_person, :expects => [Person]
>
> When I do this I get an error saying that I cannot have ActiveRecord
> objects as parameters. Fine. I can have AWS Structs as parameters. I
> don''t want to start ''maintaining'' a struct
everytime I change the table
> structure od Persons.
>
> So, is there an elegant way to ''port'' my ActiveRecod
Person to my Struct
> Person, or, is there another way to make use of my ActiveRecord Person
> to be able to pass it in as a parameter to my webservice method?
>
> Thanks
> Joerg
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
http://www.codyfauser.com