did not quite look into it. But i strongly suspect this "(0.2ms) SELECT 1 FROM "scripts" WHERE "scripts"."startp" = 0.0 LIMIT 1"
This will return true/1 in any condition. -- rubyonrailsx Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, March 16, 2012 at 1:40 PM, Soichi Ishida wrote: > Looking at the log... > The first one is successful in creating the first Script, the second > one is not. > SQL is not working for the second but certainly after_save method is > called..('first script action HERE!!!!!!' is logger.info > (http://logger.info)). > > Does it help? > > soichi > > > > Started POST "/videos" for 127.0.0.1 at 2012-03-16 14:08:42 +0900 > Processing by VideosController#create as HTML > Parameters: {"utf8"=>"✓", > "authenticity_token"=>"/AYk7ocjjteBKH8fDpQZ7FKzme/0nSsT2kalq8FgI18=", > "video"=>{"title"=>"Rush Limbaugh Calls a Female Georgetown Student, > Sandra Fluke, a 'Slut'", > "url"=>"http://www.youtube.com/watch?v=3KNpn-XGM04", "language"=>"1", > "genre"=>"news"}, "commit"=>"Create Video"} > User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = > 1 LIMIT 1 > SQL (0.7ms) INSERT INTO "videos" ("created_at", "genre", "language", > "title", "updated_at", "url", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?) > [["created_at", Fri, 16 Mar 2012 14:08:43 JST +09:00], ["genre", > "news"], ["language", "1"], ["title", "Rush Limbaugh Calls a Female > Georgetown Student, Sandra Fluke, a 'Slut'"], ["updated_at", Fri, 16 Mar > 2012 14:08:43 JST +09:00], ["url", > "http://www.youtube.com/watch?v=3KNpn-XGM04"], ["user_id", 1]] > first script action HERE!!!!!! > (0.2ms) SELECT 1 FROM "scripts" WHERE "scripts"."startp" = 0.0 LIMIT > 1 > SQL (0.5ms) INSERT INTO "scripts" ("created_at", "startp", "text", > "updated_at", "video_id") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, > 16 Mar 2012 14:08:43 JST +09:00], ["startp", > #<BigDecimal:102b7cd18,'0.0',9(36)>], ["text", "ToDo: "], ["updated_at", > Fri, 16 Mar 2012 14:08:43 JST +09:00], ["video_id", 11]] > Redirected to http://localhost:3001/videos/11 > Completed 302 Found in 211ms > > > > > Started POST "/videos" for 127.0.0.1 at 2012-03-16 14:08:59 +0900 > Processing by VideosController#create as HTML > Parameters: {"utf8"=>"✓", > "authenticity_token"=>"/AYk7ocjjteBKH8fDpQZ7FKzme/0nSsT2kalq8FgI18=", > "video"=>{"title"=>"bergman trailer persona", > "url"=>"http://www.youtube.com/watch?v=XZsU_ACYSAA", "language"=>"1", > "genre"=>"persona"}, "commit"=>"Create Video"} > User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = > 1 LIMIT 1 > SQL (0.7ms) INSERT INTO "videos" ("created_at", "genre", "language", > "title", "updated_at", "url", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?) > [["created_at", Fri, 16 Mar 2012 14:09:00 JST +09:00], ["genre", > "persona"], ["language", "1"], ["title", "bergman trailer persona"], > ["updated_at", Fri, 16 Mar 2012 14:09:00 JST +09:00], ["url", > "http://www.youtube.com/watch?v=XZsU_ACYSAA"], ["user_id", 1]] > first script action HERE!!!!!! > (0.2ms) SELECT 1 FROM "scripts" WHERE "scripts"."startp" = 0.0 LIMIT > 1 > Redirected to http://localhost:3001/videos/12 > Completed 302 Found in 207ms > > -- > 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 [email protected] > (mailto:[email protected]). > To unsubscribe from this group, send email to > [email protected] > (mailto:[email protected]). > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

