association decoration conflagration
Closed this issue · 3 comments
gurgeous commented
ActiveDecorator generally does a nice job decorating active record associations, but there are gaps. For example:
author = ActiveDecorator::Decorator.instance.decorate(Author.first)
puts author.books.first.is_a?(ActiveDecorator::Decorated) # => true
puts author.books.order(:id).first.is_a?(ActiveDecorator::Decorated) # => false
Same for includes
. This is easy enough to workaround and I don't want to complicate the gem, but I figured I'd raise the issue so we can document the behavior and consider fixes.
Thanks for all your hard work on this gem!
vendethiel commented
That second line seems to be missing a .first after the .order call.
gurgeous commented
thx, fixed my pseudocode