On 5 July 2012 23:29, cyber c. <lists@ruby-forum.com> wrote:
>>Now run the app, bring up the index and note the count shown (what is
>>it and how many records do you see), add a record and then show the
>>index again. Does the count change? Post the log for that complete
>>cycle.
>
>
> The count shown is old , doesnt include the newly created one.
>
>
> Started GET "/trials/new" for 127.0.0.1 at Thu Jul 05 15:22:17 -0700
> 2012
> Processing by TrialsController#new as HTML
> Rendered trials/_form.html.erb (43.9ms)
> Rendered trials/new.html.erb within layouts/application (54.3ms)
> Completed 200 OK in 90ms (Views: 88.9ms | ActiveRecord: 0.0ms)
>
>
> Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05
> 15:22:17 -0700 2012
> Served asset /trials.css - 304 Not Modified (0ms)
>
>
> Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05
> 15:22:17 -0700 2012
> Served asset /trials.js - 304 Not Modified (0ms)
>
>
> Started POST "/trials" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012
> Processing by TrialsController#create as HTML
> Parameters: {"commit"=>"Create Trial",
> "authenticity_token"=>"cDA9t9ShPJPyZAOQH8rlXS038tLGJGCE9nItrHrD8JA=",
> "trial"=>{"name"=>"python", "email"=>"me@gmail.com"}, "utf8"=>"✓"}
> ^[[1m^[[35m (0.1ms)^[[0m begin transaction
> ^[[1m^[[36mSQL (31.6ms)^[[0m ^[[1mINSERT INTO "trials" ("created_at",
> "email", "name", "updated_at") VALUES (?, ?, ?, ?)^[[0m [["created_at",
> Thu, 05 Jul 2012 22:22:41 UTC +00:00], ["email", "me@gmail.com"],
> ["name", "python"], ["up
> ^[[1m^[[35m (1.2ms)^[[0m commit transaction
> Redirected to http://localhost:3001/trials/3
> Completed 302 Found in 40ms (ActiveRecord: 32.9ms)
>
>
> Started GET "/trials/3" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012
> Processing by TrialsController#show as HTML
> Parameters: {"id"=>"3"}
> ^[[1m^[[36mTrial Load (0.3ms)^[[0m ^[[1mSELECT "trials".* FROM
> "trials" WHERE "trials"."id" = ? LIMIT 1^[[0m [["id", "3"]]
> Rendered trials/show.html.erb within layouts/application (2.6ms)
> Completed 200 OK in 29ms (Views: 25.7ms | ActiveRecord: 0.3ms)
>
>
> Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05
> 15:22:41 -0700 2012
> Served asset /trials.css - 304 Not Modified (0ms)
>
>
> Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05
> 15:22:41 -0700 2012
> Served asset /trials.js - 304 Not Modified (0ms)
>
>
> Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:22:43 -0700 2012
> Processing by TrialsController#index as HTML
> Rendered trials/index.html.erb within layouts/application (2.8ms)
> Completed 200 OK in 11ms (Views: 11.0ms | ActiveRecord: 0.0ms)
Once again note that there is no sql showing the trials being fetched
> ...
> I see the newer count (expected) once i restart the server
>
> log:
>
> Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:27:08 -0700 2012
> Connecting to database specified by database.yml
> Processing by TrialsController#index as HTML
> Trial Load (0.1ms) SELECT "trials".* FROM "trials"
> Rendered trials/index.html.erb within layouts/application (7.2ms)
> Completed 200 OK in 94ms (Views: 72.9ms | ActiveRecord: 1.3ms)
Here we /do/ see the sql fetching the records. Very odd. There must
be something going wrong with the caching. Have you changed anything
in the the config directory other than database.yml and routes.rb?
Specifically environment.rb or anything in config/environments? Are
you including any gems that might be relevant?
Post database.yml and the result of
gem list
Has anyone else seen this situation before?
Colin
--
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@googlegroups.com.
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-US.
No comments:
Post a Comment