Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ternary operation and more readable code. #1659

Closed
wants to merge 1 commit into from

Conversation

bagwanpankaj
Copy link
Contributor

No description provided.

dom_class(record, prefix || NEW)
end
record_id = record_key_for_dom_id(record)
record_id ? "#{dom_class(record, prefix)}#{JOIN}#{record_id}" : dom_class(record, prefix || NEW)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My 2 cents: This is not much readable compared to original.

@dmathieu
Copy link
Contributor

Ternary conditions instead of "normal" ones don't make things more readable. Neither do parenthesis.
I don't think this should be merged.

@pixeltrix
Copy link
Contributor

Whether these changes make things more readable is a matter of subjective opinion, however they do pollute the timeline and reduce the effectiveness of tools like git blame. If people want something simple to do then we've obviously got a few places in the helpers where strings are modified in place causing the recent spate of SafeBuffer related issues. Tracking down these is a much better use of everyone's time especially with 3.0.9 and 3.1 releases imminent.

@pixeltrix pixeltrix closed this Jun 12, 2011
jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants