Hi, When I added this association... class User < ActiveRecord::Base has_one :notify end ...and tried then to update column in User table it will call queries for notify table automatic? Output --------------------------------------------------------------- User Columns (0.041488) SHOW FIELDS FROM `users` User Load (0.001544) SELECT * FROM `users` WHERE (`users`.`nickname` = ''jamal'') LIMIT 1 SQL (0.000373) BEGIN SQL (0.001843) SHOW TABLES User::Notify Load (0.001113) SELECT * FROM `user_notifies` WHERE (user_notifies.user_id = 1) LIMIT 1 User::Notify Load (0.001009) SELECT * FROM `user_notifies` WHERE (user_notifies.user_id = 1) LIMIT 1 User::Notify Load (0.000996) SELECT * FROM `user_notifies` WHERE (user_notifies.user_id = 1) LIMIT 1 User::Notify Load (0.000862) SELECT * FROM `user_notifies` WHERE (user_notifies.user_id = 1) LIMIT 1 User::Notify Load (0.000849) SELECT * FROM `user_notifies` WHERE (user_notifies.user_id = 1) LIMIT 1 User::Notify Load (0.000799) SELECT * FROM `user_notifies` WHERE (user_notifies.user_id = 1) LIMIT 1 User Update (0.000362) UPDATE `users` SET `created_at` = ''2007-11-17 19:02:16'', `times_logged_in` = 0, `hashed_password` ''e0195770807aa8c82b0b128d9c0423b5ad035172'', `logged_at` = ''2007-11-25 14:58:56'', `nickname` = ''Jamal'', `email` = ''jamal-fqskXWjLZVE@public.gmane.org'' WHERE `id` 1 User::Notify Load (0.000768) SELECT * FROM `user_notifies` WHERE (user_notifies.user_id = 1) LIMIT 1 User::Notify Load (0.000781) SELECT * FROM `user_notifies` WHERE (user_notifies.user_id = 1) LIMIT 1 --------------------------------------------------------------- This is how I updated the column.>> user = User.find_by_nickname ''jamal''=> #<User id: 1, email: "jamal-fqskXWjLZVE@public.gmane.org", nickname: "Jamal", hashed_password: "e0195770807aa8c82b0b128d9c0423b5ad035172", logged_at: "2007-11-25 14:55:52", created_at: "2007-11-17 19:02:16", times_logged_in: 0>>> user.logged_at = Time.now=> Sun Nov 25 14:58:56 +0100 2007>> user.save=> true Is notify resevered word? or is there something I missed :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yes it is. I felt similar pain once! http://thinedgeofthewedge.blogspot.com/2006/06/notify.html On Nov 25, 2:07 pm, Jamal Soueidan <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > When I added this association... > > class User < ActiveRecord::Base > has_one :notify > end > > ...and tried then to update column in User table it will call queries > for notify table automatic? > > Output > --------------------------------------------------------------- > User Columns (0.041488) SHOW FIELDS FROM `users` > User Load (0.001544) SELECT * FROM `users` WHERE (`users`.`nickname` > = ''jamal'') LIMIT 1 > SQL (0.000373) BEGIN > SQL (0.001843) SHOW TABLES > User::Notify Load (0.001113) SELECT * FROM `user_notifies` WHERE > (user_notifies.user_id = 1) LIMIT 1 > User::Notify Load (0.001009) SELECT * FROM `user_notifies` WHERE > (user_notifies.user_id = 1) LIMIT 1 > User::Notify Load (0.000996) SELECT * FROM `user_notifies` WHERE > (user_notifies.user_id = 1) LIMIT 1 > User::Notify Load (0.000862) SELECT * FROM `user_notifies` WHERE > (user_notifies.user_id = 1) LIMIT 1 > User::Notify Load (0.000849) SELECT * FROM `user_notifies` WHERE > (user_notifies.user_id = 1) LIMIT 1 > User::Notify Load (0.000799) SELECT * FROM `user_notifies` WHERE > (user_notifies.user_id = 1) LIMIT 1 > User Update (0.000362) UPDATE `users` SET `created_at` = ''2007-11-17 > 19:02:16'', `times_logged_in` = 0, `hashed_password` > ''e0195770807aa8c82b0b128d9c0423b5ad035172'', `logged_at` = ''2007-11-25 > 14:58:56'', `nickname` = ''Jamal'', `email` = ''ja...-fqskXWjLZVE@public.gmane.org'' WHERE `id` > 1 > User::Notify Load (0.000768) SELECT * FROM `user_notifies` WHERE > (user_notifies.user_id = 1) LIMIT 1 > User::Notify Load (0.000781) SELECT * FROM `user_notifies` WHERE > (user_notifies.user_id = 1) LIMIT 1 > > --------------------------------------------------------------- > > This is how I updated the column. > > >> user = User.find_by_nickname ''jamal'' > > => #<User id: 1, email: "ja...-fqskXWjLZVE@public.gmane.org", nickname: "Jamal", > hashed_password: "e0195770807aa8c82b0b128d9c0423b5ad035172", logged_at: > "2007-11-25 14:55:52", created_at: "2007-11-17 19:02:16", > times_logged_in: 0>>> user.logged_at = Time.now > > => Sun Nov 25 14:58:56 +0100 2007>> user.save > > => true > > Is notify resevered word? or is there something I missed :) > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
John Ward wrote:> Yes it is. I felt similar pain once! > > http://thinedgeofthewedge.blogspot.com/2006/06/notify.html > > On Nov 25, 2:07 pm, Jamal Soueidan <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Thanks :D -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You could try notification instead of notify. JohnW wrote:> Yes it is. I felt similar pain once! > > http://thinedgeofthewedge.blogspot.com/2006/06/notify.html > > On Nov 25, 2:07 pm, Jamal Soueidan <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > >> Hi, >> >> When I added this association... >> >> class User < ActiveRecord::Base >> has_one :notify >> end >> >> ...and tried then to update column in User table it will call queries >> for notify table automatic? >> >> Output >> --------------------------------------------------------------- >> User Columns (0.041488) SHOW FIELDS FROM `users` >> User Load (0.001544) SELECT * FROM `users` WHERE (`users`.`nickname` >> = ''jamal'') LIMIT 1 >> SQL (0.000373) BEGIN >> SQL (0.001843) SHOW TABLES >> User::Notify Load (0.001113) SELECT * FROM `user_notifies` WHERE >> (user_notifies.user_id = 1) LIMIT 1 >> User::Notify Load (0.001009) SELECT * FROM `user_notifies` WHERE >> (user_notifies.user_id = 1) LIMIT 1 >> User::Notify Load (0.000996) SELECT * FROM `user_notifies` WHERE >> (user_notifies.user_id = 1) LIMIT 1 >> User::Notify Load (0.000862) SELECT * FROM `user_notifies` WHERE >> (user_notifies.user_id = 1) LIMIT 1 >> User::Notify Load (0.000849) SELECT * FROM `user_notifies` WHERE >> (user_notifies.user_id = 1) LIMIT 1 >> User::Notify Load (0.000799) SELECT * FROM `user_notifies` WHERE >> (user_notifies.user_id = 1) LIMIT 1 >> User Update (0.000362) UPDATE `users` SET `created_at` = ''2007-11-17 >> 19:02:16'', `times_logged_in` = 0, `hashed_password` >> ''e0195770807aa8c82b0b128d9c0423b5ad035172'', `logged_at` = ''2007-11-25 >> 14:58:56'', `nickname` = ''Jamal'', `email` = ''ja...-fqskXWjLZVE@public.gmane.org'' WHERE `id` >> 1 >> User::Notify Load (0.000768) SELECT * FROM `user_notifies` WHERE >> (user_notifies.user_id = 1) LIMIT 1 >> User::Notify Load (0.000781) SELECT * FROM `user_notifies` WHERE >> (user_notifies.user_id = 1) LIMIT 1 >> >> --------------------------------------------------------------- >> >> This is how I updated the column. >> >> >>>> user = User.find_by_nickname ''jamal'' >>>> >> => #<User id: 1, email: "ja...-fqskXWjLZVE@public.gmane.org", nickname: "Jamal", >> hashed_password: "e0195770807aa8c82b0b128d9c0423b5ad035172", logged_at: >> "2007-11-25 14:55:52", created_at: "2007-11-17 19:02:16", >> times_logged_in: 0>>> user.logged_at = Time.now >> >> => Sun Nov 25 14:58:56 +0100 2007>> user.save >> >> => true >> >> Is notify resevered word? or is there something I missed :) >> -- >> Posted viahttp://www.ruby-forum.com/. >> > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ryan wrote:> You could try notification instead of notify.I was trying to find another word, you just helped me out :D Thanks... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Seemingly Similar Threads
- autotest debugger?
- mySQL 5.0 upgrade - incompatible DateTime format?
- Introducing MailJack: autogenerate querystring parameters that are appended to links in your emails
- Rails 2.0 ActionMailer breaks my redmine render_message
- experimental rails story adapter in trunk