GitHub PullRequestReviewCommentEvent at 2014-01-04 22:37:59
Repository: rails
Actor: rafaelfranca
Payload: {"comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/8653387","id":8653387,"diff_hunk":"@@ -786,19 +786,25 @@ def select_month\n       end\n \n       def select_year\n+        middle_years = [Date.today.year]\n+\n         if !@datetime || @datetime == 0\n           val = '1'\n-          middle_year = Date.today.year\n         else\n-          val = middle_year = year\n+          val = year\n+          if year.abs === Float::INFINITY\n+            middle_years = [year]\n+          else\n+            middle_years.push(year)\n+          end\n         end\n \n         if @options[:use_hidden] || @options[:discard_year]\n           build_hidden(:year, val)\n         else\n           options                     = {}\n-          options[:start]             = @options[:start_year] || middle_year - 5\n-          options[:end]               = @options[:end_year] || middle_year + 5\n+          options[:start]             = @options[:start_year] || middle_years.min - 5","path":"actionview/lib/action_view/helpers/date_helper.rb","position":25,"original_position":25,"commit_id":"a053b48d39444bd19537036b27a7ce2ae43580df","original_commit_id":"a053b48d39444bd19537036b27a7ce2ae43580df","user":{"login":"rafaelfranca","id":47848,"avatar_url":"https://gravatar.com/avatar/0525b332aafb83307b32d9747a93de03?d=https%3A%2F%2Fidenticons.github.com%2F2c7b84fa30f0cea96a90729afe2970a0.png&r=x","gravatar_id":"0525b332aafb83307b32d9747a93de03","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"body":"Yes, I'm aware of this issue. What I'm trying to explain here is: we will not solve this problem adding more magic in this method. Adding more magic in the method will only add more confusion to users. After this \"Why is the select taking in consideration the selected value?\" is not a simple answer anymore.\r\n\r\nFor the issue you mentioned above I'd say, define the `end` value. If you think better if a validation error occurs hardly users will change another date.\r\n\r\nI want to go simpler, or we change this behavior to do less magic or we keep it as it is. More magic is not an option here since it will only add more confusion.\r\n\r\nRight now, I'm inclined to keep it as it is, since it will not require any change in the people application and the current behavior is documented.","created_at":"2014-01-04T22:37:59Z","updated_at":"2014-01-04T22:37:59Z","html_url":"https://github.com/rails/rails/pull/13591#discussion_r8653387","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/13591","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/8653387"},"html":{"href":"https://github.com/rails/rails/pull/13591#discussion_r8653387"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/13591"}}}}