I think it might have been a change in Rails 4 where a query like User.where(username:'myuser').select(:created_at).first
will include the id
value even though it wasn't a part of the select. You can exclude it with:
User.where(username:'myuser').select(:created_at).first.to_json(except: :id)