Created by: mrbrdo
#143 (closed) This works well for us with the Sequel adapter.
There is only one concern I still have. Right now I wrap models/records/relations into wrapper objects as soon as possible. This unfortunately means that if the user overrides something (e.g. a view), he will get wrapper objects instead of actual AR records. The wrapper does proxy all methods to the actual record, and it defines to_model so polymorphic_url works properly, but I'm not sure if this is the best solution.
I see 2 possible alternatives:
- include a module into the base classes that adds a method such as
#agnostic
, which returns the wrapper. then go through this method inside administrate - use class methods ("helpers") instead of wrappers, and use that in administrate instead of calling methods on the records/models/relations
The spec failures are due to equality checks (wrapper object with wrapped object).
Or keep the current approach if it's good enough. What do you think?