Awesome, Taryn! I suggest pairing up with Josh Peek, who's current
working on Active Model for Google Summer of Code, to start merging
your work in ASAP.
Best,
jeremy
Mike
Previously we've discussed requesting:
/posts/new.xml
Which could return an 'empty object' which would tell you all the
columns and their relative defaults. I'm not sure if anything came of
this but it could be worth looking into.
Another option would be to just declare the attributes and their types
in your ARes model declarations. I know everyone likes the idea of
self-learning-self-aware XML webservices magic, but 99 times out of
100 you know the attributes of the object you're building a service
against.
Either way, nice work!
--
Cheers
Koz
Hit the /new resource once and cache, like introspecting db columns.
>> Another option would be to just declare the attributes and their types
>> in your ARes model declarations. I know everyone likes the idea of
>> self-learning-self-aware XML webservices magic, but 99 times out of
>> 100 you know the attributes of the object you're building a service
>> against.
>
> Yup - this was exactly the idea. In the HyperactiveResource plugin
> we've been using - this is done simply with the 'columns' accessor...
> which is then used internally just as 'columns' is used in Active
> Record... which makes it neat.
> The naming of this accessor can be anything... "fields" perhaps... but
> using "columns" just means that any plugins that currently work on
> AR's columns can Just Work with ARes... which is nice ;)
Declaring attributes in a common Active Model style would rock.
>> Either way, nice work!
>
> thanks :)
Seconded! :)
Best,
jeremy