optimize query for root attachment to filter db-side

test plan: no visible change in behavior, attachments should still get
root attachments assigned when appropriate.

Change-Id: I866a81b6da81a744483fcadb2bff5b74d229619b
Reviewed-on: https://gerrit.instructure.com/13041
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
query the slave for some expensive queries

Change-Id: Ic2716b75551a85fc028fa7ac0673bf5cb01f14d1
Reviewed-on: https://gerrit.instructure.com/13042
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
avoid trying to change a user's locale while in a slave-query block

test plan: visit a canvas course as a new user who has their browser set
to a non-en locale. you shouldn't see a page error.

Change-Id: I5f0447faaec4971a08082de9819d9be79f19935f
Reviewed-on: https://gerrit.instructure.com/13062
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
directly return the avatar url in api responses

This will bypass a lot of extra rails requests on things like discusison
topic pages.

refs #9679

test plan: load a discussion topic with lots of user avatars of
different types, veryify they still display correctly.

Change-Id: I29829806da30410c6b938ff3bcf54329a58698c4
Reviewed-on: https://gerrit.instructure.com/13050
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
directly refer to the user avatar url for views

refs #9679

Often we already have the user loaded. Sometimes we don't, like when
displaying a stream item where only the user id is serialized to the
data blob. In these cases, we load the user now. This can make the
request slightly slower, but that's still more optimal than making
another separate request that loads the user.

test plan: avatars should still display as expected throughout the app,
but the urls canvas puts in the html will change -- they will directly
point at the image url now, rather than going through /images/users/XX

Change-Id: I418b81ee59aecd0ffd0c55c8ac305b77115f464e
Reviewed-on: https://gerrit.instructure.com/13061
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>

Conflicts:

	app/views/context/roster.html.erb
ignore incoming messages for deleted accounts

test plan:
 * get some notifications for discussions, conversations, etc.
 * delete the root account
 * reply to the notifications via e-mail
 * undelete the root account
 * the replies should not show up

Change-Id: I2afe5de256cbd55ca360a4327150871ea40d7493
Reviewed-on: https://gerrit.instructure.com/12902
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
a few more things to skip for deleted root accounts refs #6891

Change-Id: Id56c0f9a157734483fad29ffd95b9ea146ff1002
Reviewed-on: https://gerrit.instructure.com/13060
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
updated en.yml

Change-Id: I090a91b45574dddaeae70eb5ee410a0459832dd6
treesame commit of origin/stable/2012-08-18

Treesame-Commit-Id: 923e27370b293a449f669b11df3a7f4d15929ea5