-
Notifications
You must be signed in to change notification settings - Fork 899
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
My two cents on what widget.versions.last.next_version should return. #124
Comments
Thanks for the feedback, Josh. Much appreciated! |
Hi, just my 2c - I would personally vote for I could imagine writing an ERb view like this: <% if version.next_version %>
<%= link_to "Next version", url_for_version(version.next_version) %>
<% else %>
<p>This is the current version.</p>
<% end %> Cheers |
Good point ndbroadbent. I could see it being used like that as well but you're really asking a question at that point. How about something like:
|
That's true, it's more of a question. In that case, I would prefer the inverse:
I don't know if that resolves it though... My gut feeling is still telling me that it might be better to debug an |
I'm convinced. I think return nil would be the safest bet. Adding a |
Isn't that what |
Semantically, the live object represents the very last version of that object. It is the "Live Version". |
Hey guys, I know I'm a little late to the conversation, but I agree with what @hazah said, and in the latest release ( If you want to know whether the object returned by See #200 for my rationale, as well as the commit where the change was made. If someone has strong objections to this, we can revisit this, but I truly feel that the live version should be considered a version, and as such should not be ignored by the |
Awesome gem Andy.
Just reading through and noticed your call for opinions: "As an aside, I'm undecided about whether widget.versions.last.next_version should return nil or self (i.e. widget). Let me know if you have a view."
I would say return self, or widget, when this happens. That seems more intuitive, even if it masks an "incorrect" action.
Cheers,
Josh
The text was updated successfully, but these errors were encountered: