# Problem with rails 2.1.0 & its older versions

**URL:** <https://www.ruby-forum.com/t/problem-with-rails-2-1-0-its-older-versions/142478>\
**Category:** Rails\
**Created:** [July 8, 2008, 11:45am UTC](https://www.ruby-forum.com/t/problem-with-rails-2-1-0-its-older-versions/142478 "2008-07-08T11:45:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lostwarrior](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@lostwarrior](https://www.ruby-forum.com/u/lostwarrior)\
**Post date:** [July 8, 2008, 11:45am UTC](https://www.ruby-forum.com/t/problem-with-rails-2-1-0-its-older-versions/142478/1 "2008-07-08T11:45:16Z")

</div>

hi to everyone .i am using rails 2.1.0 for my current project.in the  
console mode i tried to excute the statement in console mode

User.find(:first,:select=\>â€name as text,id as valueâ€).to\_json

=\> â€œ{\â€user\â€: {\â€text\â€: \â€thillai\â€, \â€value\â€: \â€1\â€}}â€

in rails 2.1.0 its giving the model name user also

but in rails 2.0.2 the results are coming as

{\â€text\â€: \â€thillai\â€, \â€value\â€: \â€1\â€}

as per my requirement i want results to be

{\â€text\â€: \â€thillai\â€, \â€value\â€: \â€1\â€}.

Is there any solution for this problem

---

<div class="post-metadata">

**Author:** ![lostwarrior](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a88e57/32.png) [@lostwarrior](https://www.ruby-forum.com/u/lostwarrior)\
**Post date:** [July 8, 2008, 11:55am UTC](https://www.ruby-forum.com/t/problem-with-rails-2-1-0-its-older-versions/142478/2 "2008-07-08T11:55:28Z")

</div>

On Jul 8, 10:45 am, Lost W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> {\”text\”: \”thillai\”, \”value\”: \”1\”}
> 
> as per my requirement i want results to be
> 
> {\”text\”: \”thillai\”, \”value\”: \”1\”}.

I would have thought that some\_user.attributes.to\_json would always  
give you the second form.

Fred
