Timo Schilling

Results 164 comments of Timo Schilling

Draper defines a `to_s` method in each decorator. https://github.com/drapergem/draper/blob/master/lib/draper/decorator.rb#L206

Just define a `display_name` method on your model or decorator and every thing is fine

It is a bug in draper, he delegates a method which didn't exist on the decorated object

Yes but for that we have the `resource.method(method).source_location` check

Why you didn't define a `display_name` method?

Should we really fix a bug of draper in AA? But we can improve the method detection in AA of course. But we should do that in a way that...

The problem is that we can check that `to_s` is overwritten, but we can't check how has overwritten it. That's way the solution is to define your own `display_name` method....

Many people have models like this: ``` class User def name "#{firstname} #{lastname}" end def to_s name end end ``` For that we have the `to_s` in `display_name_methods`, not for...

What you want is solving your problem by moving the same problem to other people.