code4lib/ruby-oai — pull request #6 by seandmccarthy (2012-05-30 05:28:09+00:00)
Title: Changes to ActiveRecordWrapper

In trying to use ActiveRecordWrapper in a Rails Engine, I came across 2 issues.

1st, was "TypeError (can't convert Time into String)", caused by the argument to Time.parse being a Time object itself.

2nd was that even if I implement map_{prefix} in my model, if I used ActiveRecordWrapper to wrap my model, then when OAI::Provider::Metadata::Format.encode asked if model.respond_to("map_#{prefix}") it would be false. This is because "model" is an ActiveRecordWrapper and not the class of the wrapped model.

I've fixed both issues in this commit.