Thanks for this, Justin. I ran into the same problem with a new site, and this message saved the day!!! ~ Alexus
On Dec 22, 7:06 am, Matt <[email protected]> wrote: > Thanks! That seemed to do the trick. I know I can make this > modification manually ... but is there a way to do the merge with git? > (I'm a git newbie). > > -Matt > > On Dec 21, 5:01 pm, Justin G <[email protected]> wrote: > > > > > Matt, > > > > activities.map{|a| find(a.user_id) } > > > I ran into this exact same problem recently. You are absolutely > > correct, in the line above find is being called with a scope. In this > > case from a call in base_controller (scope: active). > > User.active.find_by_activity({:limit => 5, :require_avatar => false}) > > > The call to Activity.since doesn't have this scope and can return > > unactivated users if they created an account but didn't activate it > > yet. I found the following change already in edge which adds another > > condition to ensure the activity only returns active users. > > >http://github.com/bborn/communityengine/commit/21836ef1e9df5051a590f7... > > > - :conditions => "#{options[:require_avatar] ? ' users.avatar_id > > IS NOT NULL' : nil}", > > + :conditions => "#{options[:require_avatar] ? ' users.avatar_id > > IS NOT NULL AND ' : ''} users.activated_at IS NOT NULL", > > > The additional scoping could probably be removed from the function > > call as well, but for now I have made the change above and it works. > > > Justin -- You received this message because you are subscribed to the Google Groups "CommunityEngine" 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/communityengine?hl=en.
