Hi,
I'm trying to get an inline representer working. I've got an small example
which I think is very similar to what's in the README, but I'm getting an
exception. The code is here:
https://gist.github.com/rsutphin/6165202
(This code just uses Representable, but my ultimate goal is to use this
with Roar. I hope it's okay to ask here.)
The full trace is in the gist also, but the short version is this:
lib/representable/binding.rb:139:in `serialize': undefined method
`to_hash' for #<struct Song title="Ana Ng", track=1> (NoMethodError)
Any suggestions about what I'm doing wrong? This looks like the same error
you get when you don't specify :extend on a collection, so it seems like
the inline representer just isn't being picked up.
There's a reported issue in Representable about inline decorators[1], but
not extend-type representers. If this is a bug (and not something that I'm
missing), I'll be happy to file it.
Thanks,
Rhett
[1]:
https://github.com/apotonick/representable/issues/52