apotonick/roar — Issue #6: rails 2.3? ruby 1.8.7?
Author: kookster
Created: 2011-12-31 05:47:42+00:00
State: open

Hello,

Have you tested this gem with rails 2.3 or ruby 1.8.7?

I've been messing with the gem, and while it does not seem to be declared, it does not work with ruby 1.8.7 because it uses public_send in 3 places:

./lib/roar/representer/feature/model_representing.rb:62	value = public_send(definition.getter)
./lib/roar/representer.rb:19	attributes.each { |p,v| representer.public_send("#{p}=", v) }
./lib/roar/representer.rb:29	value = public_send(definition.getter)

I used the patch fro ActiveSupport to backport public_send to 1.8.7, but without that I got a method not found for these.

I am also seeing issues where extending a Representer in an AR 2.3 object does not act as expected.
For attributes that are in the representer and the model, assignment does not stick.

I'm debugging it now, but seems to be something about how the attribute assignment method are implemented in 2.3 (method_missing perhaps?) that does not play with the representer.