{"action":"closed","issue":{"url":"https://api.github.com/repos/rails/rails/issues/21626","labels_url":"https://api.github.com/repos/rails/rails/issues/21626/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/21626/comments","events_url":"https://api.github.com/repos/rails/rails/issues/21626/events","html_url":"https://github.com/rails/rails/issues/21626","id":106411796,"number":21626,"title":"Duplicating scope conditions","user":{"login":"brunorails","id":215518,"avatar_url":"https://avatars.githubusercontent.com/u/215518?v=3","gravatar_id":"","url":"https://api.github.com/users/brunorails","html_url":"https://github.com/brunorails","followers_url":"https://api.github.com/users/brunorails/followers","following_url":"https://api.github.com/users/brunorails/following{/other_user}","gists_url":"https://api.github.com/users/brunorails/gists{/gist_id}","starred_url":"https://api.github.com/users/brunorails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunorails/subscriptions","organizations_url":"https://api.github.com/users/brunorails/orgs","repos_url":"https://api.github.com/users/brunorails/repos","events_url":"https://api.github.com/users/brunorails/events{/privacy}","received_events_url":"https://api.github.com/users/brunorails/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/activerecord","name":"activerecord","color":"0b02e1"},{"url":"https://api.github.com/repos/rails/rails/labels/needs%20feedback","name":"needs feedback","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-14T19:30:29Z","updated_at":"2015-09-26T13:32:43Z","closed_at":"2015-09-26T13:32:43Z","body":"Rails 4.1.3\r\nWhen i call a scope twice, the result is:\r\n```\r\n> Bill.not_paid.not_paid.to_sql\r\n=> \"SELECT `bills`.* FROM `bills`  WHERE `bills`.`paid` = 0\"\r\n```\r\n\r\nRails 4.2.4 is duplicating the condition:\r\n```\r\n> Bill.not_paid.not_paid.to_sql\r\n=> \"SELECT `bills`.* FROM `bills` WHERE `bills`.`paid` = 0 AND `bills`.`paid` = 0\"\r\n```"}}