snowzhangxue-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jun-20 12:35 UTC
Rails 2.1 console prints ActiveRecord object in different format with rails 1.2.3
Ok, I have a project that using rails 2.1. I run ruby script/console and here is what I see:>> BannerFile.find :last=> #<BannerFile id: 29, banner_position_id: 8, client: "E2Ma Consumer Profiling", name: "H&M kledingcheque_Rectangle_13-02-08", file: "mde_7.jpg", target_url: "http://www.content-hoster.nl/f3/index.php? an=1024&i...", start_date: "2008-02-12", end_date: "2008-03-13", created_at: "2008-02-13 10:20:11", updated_at: "2008-06-20 12:00:19", status: nil, impression_count: 0, click_count: 0, file_meta: nil> This is what we see in rails 1.2.3>> b=BannerFile.find 2=> #<BannerFile:0x2320828 @attributes={"status"=>nil, "end_date"=>"2008-01-06", "start_date"=>"2008-01-05", "name"=>"flash banner", "updated_at"=>"2008-06-20 12:05:57", "target_url"=>"http:// www.sina.com.cn", "banner_position_id"=>"2", "client"=>"Carp", "id"=>"2", "click_count"=>"0", "impression_count"=>"11", "file_meta"=>nil, "created_at"=>"2008-01-07 07:08:20", "file"=>"121409_home-284bt.swf"}> See the difference? So can anyone tell me why in rails 2.1 activerecord object is printed differently? Thanks. Snow --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Jun-21 16:30 UTC
Re: Rails 2.1 console prints ActiveRecord object in different format with rails 1.2.3
On Jun 20, 1:35 pm, "snowzhang...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <snowzhang...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ok, I have a project that using rails 2.1. I run ruby script/console > and here is what I see: >The output format changed in 2.0 to make it easier to read. Fred> >> BannerFile.find :last > > => #<BannerFile id: 29, banner_position_id: 8, client: "E2Ma Consumer > Profiling", name: "H&M kledingcheque_Rectangle_13-02-08", file: > "mde_7.jpg", target_url: "http://www.content-hoster.nl/f3/index.php? > an=1024&i...", start_date: "2008-02-12", end_date: "2008-03-13", > created_at: "2008-02-13 10:20:11", updated_at: "2008-06-20 12:00:19", > status: nil, impression_count: 0, click_count: 0, file_meta: nil> > > This is what we see in rails 1.2.3 > > >> b=BannerFile.find 2 > > => #<BannerFile:0x2320828 @attributes={"status"=>nil, > "end_date"=>"2008-01-06", "start_date"=>"2008-01-05", "name"=>"flash > banner", "updated_at"=>"2008-06-20 12:05:57", "target_url"=>"http://www.sina.com.cn", "banner_position_id"=>"2", "client"=>"Carp", > "id"=>"2", "click_count"=>"0", "impression_count"=>"11", > "file_meta"=>nil, "created_at"=>"2008-01-07 07:08:20", > "file"=>"121409_home-284bt.swf"}> > > See the difference? So can anyone tell me why in rails 2.1 > activerecord object is printed differently? Thanks. > > Snow--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---