<div>
Hi all
</div><div><br></div><div>I have a class like this (simplified of course):</div><div><div><br></div><div> class FileDownload < ActiveRecord::Base</div><div> scope :status, -> { select('guid, status') }</div><div> end</div><div><br></div><div>I'm using this scope in a controller to return a json response. This worked just fine in Rails 3.2.14. The response looked like this:</div><div><br></div><div> [{ "user_id": 1234 }]</div><div><br></div><div>After upgrading to Rails 4, suddenly the response looks like this:</div><div><br></div><div> [{ "user_id": 1234, "id": null }]</div><div><br></div><div>I've also tried this on the console, and it's the same.</div><div><br></div><div>Rails 3.2:</div><div><br></div><div><img src="cid:A1B7CDA1-AE3B-4669-8436-016760047858"></div><div><br></div><div>Rails 4:</div><div><br></div><div><img src="cid:CBDDFB66-BCBA-49CA-A9FF-DDEB59553F9A"></div><div><br></div><div>Can anyone explain why the null id field is being added?</div></div><div><br></div><div>Thanks.</div><div><br></div><div>-- </div><div><div>Ed James</div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig">Sparrow</a></div><div><br></div></div>