Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uptruncate display_name_methods values #3886
Conversation
:title, | ||
:email, | ||
:to_s ] | ||
setting :display_name_methods, [ :display_name, :to_s ] |
This comment has been minimized.
This comment has been minimized.
@@ -27,7 +27,8 @@ | |||
allow(klass).to receive(:reflect_on_all_associations).and_return [ double(name: :login) ] | |||
allow(subject).to receive :login | |||
expect(subject).to_not receive :login | |||
allow(subject).to receive(:email).and_return 'foo@bar.baz' | |||
allow(ActiveAdmin.application).to receive(:display_name_methods).and_return [:login, :display_name] |
This comment has been minimized.
This comment has been minimized.
@@ -27,7 +27,8 @@ | |||
allow(klass).to receive(:reflect_on_all_associations).and_return [ double(name: :login) ] | |||
allow(subject).to receive :login | |||
expect(subject).to_not receive :login | |||
allow(subject).to receive(:email).and_return 'foo@bar.baz' | |||
allow(ActiveAdmin.application).to receive(:display_name_methods).and_return [:login, :display_name] | |||
allow(subject).to receive(:display_name).and_return 'foo@bar.baz' |
This comment has been minimized.
This comment has been minimized.
houndci-bot
Apr 9, 2015
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
e1d64ce
to
1b030c7
1b030c7
to
92f6af4
@timoschilling Was this causing an issue for you somewhere? I was always kind of a fan of this feature as a smart default |
|
The old one is sometimes confusing. I share @dmitry's opinion. The new List ist more explicit. I think about to rename I'm waiting with the merge for more discussion. |
Alright, fair enough. What if instead of changing
I think it's might be better to do this than mixing ActiveAdmin-related presentation logic into models. Thoughts? |
(This is probably beyond the scope of this PR though, and something I would be happy to tackle) |
@mattvague I like the idea of not mixing ActiveAdmin-related presentation logic into models! But what is with Models which are not registered in ActiveAdmin? How should they be configured? |
@timoschilling That's a good question. Would it make sense to just rely on If people want AA-specific display names for models that they don't want in the menu they would have 2 options:
|
@timoschilling Thoughts? |
I really don't think this is something that should change, when we haven't even gotten out 1.0.0. People have relied on this behavior for many years now, and there's no good way to warn them that it's changed. If we're going to change this, it should wait until 2.0. |
@timoschilling we are moving forward with breaking changes for master (for a v2). Are you able to update the conflicts so we can review for merging in? |
timoschilling commentedApr 9, 2015
There are some methods in that list which are to specific for some use cases. We should setup only
display_name
as ActiveAdmin default andto_s
as fallback.