I have three class,HotActivity, Activity和ActivityType
HotActivity and Activity is one to one association, Activity belongs to ActivityType
in controller I code like this
@hot_activities = HotActivity.includes(:activity)
chrome will prompt me this
user: william N+1 Query detected Activity => [:activity_type] Add to your finder: :include => [:activity_type] N+1 Query method call stack
if I add like this
@hot_activities = HotActivity.includes(:activity => :activity_type)
it prompt this
user: william Unused Eager Loading detected HotActivity => [:activity] Remove from your finder: :include => [:activity] activities:575 Uniform Notifier activities:587 user: william Unused Eager Loading detected Activity => [:activity_type] Remove from your finder: :include => [:activity_type]
some one please help,
thanks in advs
HI william,how exactly does chrome prompt that?
Uniform Notifier activities:551user: william N+1 Query detected Activity => [:activity_type] Add to your finder: :include => [:activity_type] N+1 Query method call stack /home/william/work/lly/app/views/activities/index.html.erb:48:in `block in _app_views_activities_index_html_erb___3943997569956187419_46069520' /home/william/work/lly/app/views/activities/index.html.erb:32:in `_app_views_activities_index_html_erb___3943997569956187419_46069520'
whats the view like?
is that the only line you have on your controller?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/iHKLLzvtewoJ.
For more options, visit https://groups.google.com/groups/opt_out.