{"action":"created","issue":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3760","labels_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3760/labels{/name}","comments_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3760/comments","events_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3760/events","html_url":"https://github.com/activeadmin/activeadmin/pull/3760","id":55421010,"number":3760,"title":"Add parens to method calls used as arg defaults for Ruby 2.2, fix #3733","user":{"login":"rdlugosz","id":402328,"avatar_url":"https://avatars.githubusercontent.com/u/402328?v=3","gravatar_id":"","url":"https://api.github.com/users/rdlugosz","html_url":"https://github.com/rdlugosz","followers_url":"https://api.github.com/users/rdlugosz/followers","following_url":"https://api.github.com/users/rdlugosz/following{/other_user}","gists_url":"https://api.github.com/users/rdlugosz/gists{/gist_id}","starred_url":"https://api.github.com/users/rdlugosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdlugosz/subscriptions","organizations_url":"https://api.github.com/users/rdlugosz/orgs","repos_url":"https://api.github.com/users/rdlugosz/repos","events_url":"https://api.github.com/users/rdlugosz/events{/privacy}","received_events_url":"https://api.github.com/users/rdlugosz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-25T16:36:21Z","updated_at":"2015-01-25T21:12:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/3760","html_url":"https://github.com/activeadmin/activeadmin/pull/3760","diff_url":"https://github.com/activeadmin/activeadmin/pull/3760.diff","patch_url":"https://github.com/activeadmin/activeadmin/pull/3760.patch"},"body":"Ruby 2.2 included a [bug fix](https://bugs.ruby-lang.org/issues/9593) that impacts methods which call other methods as defaults for some of their arguments, e.g., `def bar(foo=foo)`. The fix is to include parenthesis on the method call, `def bar(foo=foo())`. A similar patch was [recently made](https://github.com/rails/rails/commit/e88da370f190cabd1e9750c5b3531735950ab415) to Rails to support Ruby 2.2.\r\n\r\nI only found two instances of method calls that used the problematic syntax. Failing tests revealed these methods; the following regex did not find other instances: `def.+\\((\\S+)\\s*=\\s*\\1\\)`.\r\n\r\nAdditionally, because test-unit is not included with Ruby 2.2 (and is required for ActiveSupport 3.2.x), it has been explicitly included in the Gemfile in the Rails 3.1|2 section.\r\n\r\nTests pass; tested against Rails 3.2.16 & 3-2-stable branch on both Ruby 2.1.5 and 2.2. The JSLint test was not executed because I did not have a JRE set up; I don't think this test is relevant to the issue at hand.\r\n\r\nNote that my branch is based off of the 0-6-stable branch, but I suspect this same change is probably relevant to master."},"comment":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/comments/71393801","html_url":"https://github.com/activeadmin/activeadmin/pull/3760#issuecomment-71393801","issue_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3760","id":71393801,"user":{"login":"timoschilling","id":165599,"avatar_url":"https://avatars.githubusercontent.com/u/165599?v=3","gravatar_id":"","url":"https://api.github.com/users/timoschilling","html_url":"https://github.com/timoschilling","followers_url":"https://api.github.com/users/timoschilling/followers","following_url":"https://api.github.com/users/timoschilling/following{/other_user}","gists_url":"https://api.github.com/users/timoschilling/gists{/gist_id}","starred_url":"https://api.github.com/users/timoschilling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timoschilling/subscriptions","organizations_url":"https://api.github.com/users/timoschilling/orgs","repos_url":"https://api.github.com/users/timoschilling/repos","events_url":"https://api.github.com/users/timoschilling/events{/privacy}","received_events_url":"https://api.github.com/users/timoschilling/received_events","type":"User","site_admin":false},"created_at":"2015-01-25T21:12:06Z","updated_at":"2015-01-25T21:12:06Z","body":"I mean a rebase on top of 0-6-stable, the test are failing in your pr while there was a a bug before. \r\n\r\nYou only need to change the 2.0 line to 2.2 for Travis."}}