Commit Graph

95 Commits

Author SHA1 Message Date
Cody Cutrer b7bf2ba3fb introduce a named scope for finding non-account-pseudonyms
refs #6199, #6177

makes it easier for a plugin to modify the logic. also removed dummy
method in Account that is never hooked into.

Change-Id: I87e2cad5172f6dece4448d61dc4681a94c44cecb
testplan: login
Reviewed-on: https://gerrit.instructure.com/6982
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-15 14:47:11 -07:00
Cody Cutrer e9eec02be8 fix display of sortable name in users list refs #5317
test plan:
  create a user with a sortable name other than what is automatically
  inferred; make sure it displays correctly in the users list for the
  account

Change-Id: I12528436571ffdd211d6d2719eb1789d9afffdd2
Reviewed-on: https://gerrit.instructure.com/6732
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-11-07 16:13:41 -07:00
Brian Whitmer 6b83b9227c basic lti navigation links
By properly configuring external tools (see
/spec/models/course_spec/rb:898 for examples) they can
be added as left-side navigation links to a course,
an account, or to the user profile section of Canvas.

testing notes:
- you have to manually set options on the external tool:
- for user navigation the tool needs to be created on the root account
  with the following settings:
  {:user_navigation => {:url => <url>, :text => <tab label>} }
  (there are also some optional language options you can set using
  the :labels attribute)
- for account navigation it's the same
- for course navigation it's the same, except with :course_navigation
  there's also some additional options:
  :visibility => <value> // public, members, admins
  :default => <value> // disabled, enabled

test plan:
- configure a user navigation tool at the root account level,
  make sure it shows up in the user's profile section

- configure a course navigation tool at the account level,
  make sure it shows up in the course's navigation

- configure a course navigation tool at the course level,
  make sure it shows up in the course's navigation

- make sure :default => 'disabled' course navigation tools don't
  appear by default in the navigation, but can be enabled on
  the course settings page

- make sure :visibility => 'members' only shows up for course members

- make sure :visibility => 'admins' only shows up for course admins

- configure an account navigation tool at the account level,
  make sure it shows up in the account's navigation, and
  any sub-account's navigation

Change-Id: I977da3c6b89a9e32b4cff4c2b6b221f8162782ff
Reviewed-on: https://gerrit.instructure.com/5427
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-04 17:07:17 -06:00
Jacob Fugal 9e9040146a disable 'randomly assign students' for restricted self-signup groups
also, make the random assignment happen on the server via an ajax call.
before, it would make one ajax call per student assigned, which is
rather inefficient when there are many students to assign.

fixes #6099

Change-Id: I89e5059fa1bd42b1a25e5cb88d552841c426530a
Reviewed-on: https://gerrit.instructure.com/6576
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-11-04 12:25:44 -06:00
Zach Wily f6e13d5a2d show login label on "add user" screen for cas/saml users; fixes #6120
Since SAML/CAS users are unlikely to be using email addresses as logins, we
now show the "Login:" field always in the Add User dialog for them. They can
also specify a login label in their authentication configuration, and it
defaults to Login.

Change-Id: Idcfd876d947eb0ca104a6681a02ac11f993302ce
Reviewed-on: https://gerrit.instructure.com/6566
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-10-31 14:03:26 -06:00
Cody Cutrer 3f3f72637a expose sortable name to user, fixes #5317
* expose sortable name directly to the user
 * don't downcase it
 * use a LOWER(sortable_name) index for postgres
 * set sortable name as "last_name, first_name" explicitly for SIS imports
 * populate sortable name intelligently in the UI

Change-Id: I476641f4817e27a11b573d91f102c5a74d3eba26
Reviewed-on: https://gerrit.instructure.com/6512
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2011-10-31 12:22:08 -06:00
Cody Cutrer f99abb4e56 Revert "add distinct name part fields refs #5317"
This reverts commit 995110f555.

Change-Id: Ic00e7ced20ca9d912587e3440862ceb50e601d15
Reviewed-on: https://gerrit.instructure.com/6511
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-10-27 10:17:29 -06:00
Cody Cutrer c59c0f593f refactor user creation/invitations closes #5833
fixes #5573, #5572, #5753

 * communication channels are now only unique within a single user
 * UserList changes
   * Always resolve pseudonym#unique_ids
   * Support looking up by SMS CCs
   * Option to either require e-mails match an existing CC,
     or e-mails that don't match a Pseudonym will always be
     returned unattached (relying on better merging behavior
     to not have a gazillion accounts created)
   * Method to return users, creating new ones (*without* a
     Pseudonym) if necessary. (can't create with a pseudonym,
     since Pseudonym#unique_id is still unique, I can't have
     multiple outstanding users with the same unique_id)
 * EnrollmentsFromUserList is mostly gutted, now using UserList's
   functionality directy.
 * Use UserList for adding account admins, removing the now
   unused Account#add_admin => User#find_by_email/User#assert_by_email
   codepath
 * Update UsersController#create to not worry about duplicate
   communication channels
 * Remove AccountsController#add_user, and just use
   UsersController#create
 * Change SIS::UserImporter to send out a merge opportunity
   e-mail if a conflicting CC is found (but still create the CC)
 * In /profile, don't worry about conflicting CCs (the CC confirmation
   process will now allow merging)
   * Remove CommunicationChannelsController#try_merge and #merge
 * For the non-simple case of CoursesController#enrollment_invitation
   redirect to /register (CommunicationsChannelController#confirm)
   * Remove CoursesController#transfer_enrollment
 * Move PseudonymsController#registration_confirmation to
   CommunicationChannelsController#confirm (have to be able to
   register an account without a Pseudonym yet)
   * Fold the old direct confirm functionality in, if there are
     no available merge opportunities
   * Allow merging the new account with the currently logged in user
   * Allow changing the Pseudonym#unique_id when registering a new
     account (since there might be conflicts)
   * Display a list of merge opportunities based on conflicting
     communication channels
     * Provide link(s) to log in as the other user,
       redirecting back to the registration page after login is
       complete (to complete the merge as the current user)
   * Remove several assert_* methods that are no longer needed
 * Update PseudonymSessionsController a bit to deal with the new
   way of dealing with conflicting CCs (especially CCs from LDAP),
   and to redirect back to the registration/confirmation page when
   attempting to do a merge
 * Expose the open_registration setting; use it to control if
   inviting users to a course is able to create new users

Change-Id: If2f38818a71af656854d3bf8431ddbf5dcb84691
Reviewed-on: https://gerrit.instructure.com/6149
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-10-24 12:07:08 -06:00
Cody Cutrer 995110f555 add distinct name part fields refs #5317
Change-Id: I0d11c51d4e0e9be093b65cca2ea85ba18e99bce9
Reviewed-on: https://gerrit.instructure.com/6314
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-10-24 12:06:59 -06:00
Cody Cutrer f41047c61a account setting to disable name editing fixes #5851
also rearrange account settings slightly so that stuff that doesn't apply
to non-root accounts doesn't show for them

Change-Id: I568887a30cbf923c976e7c5bbac1036bb8e88659
Reviewed-on: https://gerrit.instructure.com/6012
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-10-10 10:59:08 -06:00
Jacob Fugal 5c8406bd35 GroupCategory model
Group#group_category_name (groups.category) and
Assignment#group_category_name (assignments.group_category) are now
deprecated.

refs #4624

Change-Id: I8fc5d03a75e962c3f649305986f77ad242d3a694
Reviewed-on: https://gerrit.instructure.com/5765
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-10-10 09:36:06 -06:00
Brian Whitmer c8aa8f65cb allow enabling avatars at the root account level
Change-Id: If9d845cb33b5e8f0baa6cb93f3a3ae56733c4df9
Reviewed-on: https://gerrit.instructure.com/5804
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-10-10 09:15:59 -06:00
Brian Palmer 2a710b2d86 course copy with replaced files, fixes #5536
Change-Id: Ie64cadffbaf801e4c28e538e503c415095865908
Reviewed-on: https://gerrit.instructure.com/5903
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-10-07 16:52:03 -06:00
Cody Cutrer 5c08799256 Remove ActiveRecord::Base.find(_all)?_cached
Just use Rails.cache.fetch directly.  This fixes some problems that
find_cached wasn't fully serializing the object.

Also, be sure to change cache keys so that we don't get data back
using the old format.

Change-Id: I8beea2f2ba446a97249a495789b25c3a71de420e
Reviewed-on: https://gerrit.instructure.com/5857
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-10-05 17:50:47 -06:00
Brian Whitmer ab1fddba77 basic lti tweaks for certification
fixes #5812

Change-Id: I34bd12bace487280d5531c4d84b1d8395059c716
Reviewed-on: https://gerrit.instructure.com/5597
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-10-04 10:59:21 -06:00
JT Olds 02e4132107 refactor sticky sis fields
Change-Id: I1cddc633b11b8937f8a3b36c2fa0a00d4d75b513
Reviewed-on: https://gerrit.instructure.com/5745
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-09-27 16:34:37 -06:00
Jacob Fugal 9bcf8d9f95 remove Account#account_groups
Change-Id: I30e98569c8c859e16ff7f158e7dff22083969762
Reviewed-on: https://gerrit.instructure.com/5762
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-09-27 12:59:14 -06:00
Brian Palmer 0432c66a24 remove deprecated ruby syntax
these are syntax errors in 1.9.x

Change-Id: I7cbd66643cb371e4be9f8da0365bf1e988ee5de8
Reviewed-on: https://gerrit.instructure.com/5833
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-09-27 10:28:22 -06:00
Cody Cutrer c330df960a when adding new admin users, create them in the target account
(note that this is the only place that assert_by_email is used)

Change-Id: I5ed8985a5a84940e50b403b3753f9102bad23164
Reviewed-on: https://gerrit.instructure.com/5772
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-09-22 10:06:39 -06:00
Brian Whitmer 0848a7aa21 change 'feedback' dialog to 'help' dialog
Changed the "feedback" link to say "help" instead, and put a
dialog in front of the original feedback dialog which helps
point users to additional useful resources.

Also added account#custom_feedback_links so that plugins can
optionally add other useful links to this help dialog.

fixes #177

Change-Id: I31e855cbf83475006dd530cd027aff123a75d56a
Reviewed-on: https://gerrit.instructure.com/5310
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-09-15 16:01:23 -06:00
Cody Cutrer 0c24ee3021 don't duplicate courses returned from the API
push the unique back to the database, so that it's consistent with
pagination

Change-Id: Ibf66de841fb09ea6b0f8b4c4cd8b468dee6ded30
Reviewed-on: https://gerrit.instructure.com/5630
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-09-13 16:10:32 -06:00
Cody Cutrer 24485249b1 remove unused columns from courses
Change-Id: I064fbde82894820bacc8604779a75c8aeb060092
Reviewed-on: https://gerrit.instructure.com/5633
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-09-13 12:53:03 -06:00
Cody Cutrer 1a9e9eb90c fix enabling/disabling services that are substrings of each other
fixes #5560

Change-Id: Ibc19f105f16454442bbcd42218407f3f8c6e8fa2
Reviewed-on: https://gerrit.instructure.com/5494
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-09-08 15:29:33 -06:00
Cody Cutrer 2e59598df9 speed up account pages a bit
* avoid joining with users just to get the count of associated_users

Change-Id: I79635e7bd189d361fb9f1deee73806ffc40d40db
Reviewed-on: https://gerrit.instructure.com/5321
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-09-07 12:21:43 -06:00
Cody Cutrer 7d1941a986 use /accounts/:id/permissions rather than /accounts/:id/role_overrides
Change-Id: I0912480e73a23a6ac8308382b47593ba6ac835c2
Reviewed-on: https://gerrit.instructure.com/5346
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-08-31 10:19:57 -06:00
Jon Jensen 06a0fc3707 question bank nav link, closes #5446
Change-Id: I62fb9ea9918fc4e3131324a6e391ef4c61078c0f
Reviewed-on: https://gerrit.instructure.com/5356
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-08-31 09:26:48 -06:00
Brian Palmer 9ad7f12914 fix i18n.t being called too early
we should probably re-visit this, it's pretty error-prone

Change-Id: Iebcb4d4d505425e757b0128d9943355efdfc58fe
Reviewed-on: https://gerrit.instructure.com/5331
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-08-30 08:55:47 -06:00
Jon Jensen b2b21a794b account-level question banks, closes #5025
phased out AssessmentQuestion#context, did some ground work for #5026
and #5027

Change-Id: Ice4567a0f069dd49da8ce57bf0c8325b0b062115
Reviewed-on: https://gerrit.instructure.com/5303
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-08-29 16:24:49 -06:00
Cody Cutrer 805d605d5c optimize sub_accounts page
Avoid n queries for sub_account counts and course counts; instead do
a single query of each type for all visible accounts (if necessary;
sub_account count might be inferred from loaded sub_accounts)

Change-Id: I46aa607f485eda8e48effefe0c5ae72ee383ac80
Reviewed-on: https://gerrit.instructure.com/5295
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-08-26 16:16:56 -06:00
Jon Jensen 032f40765d account-level option to disable eportfolios, closes #5169
also tweaked named_context_url to work better with UserProfile
contexts

Change-Id: If16ef16db507c8713436d0d88a1867f206ecdf48
Reviewed-on: https://gerrit.instructure.com/5225
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-08-24 17:38:06 -06:00
Cody Cutrer caae827136 alerts, closes #4317
* Daily job to evaluate alerts
   * Spawns a new job for each root account (for parallelization).
     It could be broken down to per-course level if needed (i.e.
     if there is a *huge* root account).
   * Evaluating criteria at a course level using efficient queries.
 * UI for CRUD on alerts
   * Render existing alerts
   * Delete existing alerts
   * Create a new alert
   * CRUD for criteria, recipients, repetition
   * Validations
 * Improve instructure_helper's formErrors to support passing errors
   for specific elements
 * Improve Rails' :include to be able to :exclude an :include
   inherited from a named scope
 * Specs!!
 * Note that we want to slowly roll this out, so there is a setting on
   root accounts to enable it

So I ran an alert with just an interaction criterion on a test
cluster against 50,000 courses, and it took less than 10 minutes
without any parallelization.  That seems like acceptable
performance to me (since there are only just over 3000 courses
in production that would even be elligible to have alerts sent
right now).  Of course, that's probably skewed because I'm sure
a bunch of those 50,000 courses were essentially empty.

Change-Id: Ie028ef206c9155b9a72fb2a820f3e0e516de562a
Reviewed-on: https://gerrit.instructure.com/4799
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-24 10:19:44 -06:00
Brian Palmer f483a19a3c api to retrieve all courses in an account
Change-Id: Ic849f61d38f4887c241b97c72edc08ed06434c20
Reviewed-on: https://gerrit.instructure.com/4973
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-23 15:58:51 -06:00
Cody Cutrer f997efd263 re-write update_account_associations for SPEED!
* Manually cache account chains (query cache gets dumped after every
   update or delete)
 * Use batch queries and preloads to make the number of queries
   constant wrt how many users are getting updated
 * Simplify calculation - find the root account ids, and merge the
   account chains together
 * Fix depth to be defined as the minimum depth to reach that account
   (rather than whichever path happened to be processed last)
 * Add incremental mode to only add accounts, rather than re-calculate
   all associations (only for User)
 * Don't auto-create the default section during
   update_account_associations; it costs a query and possibly an
   insert, causes angst with schools that don't want it, etc.
   Instead, always create associations against a 'nil' section so
   that a course has the proper associations.

Change-Id: I7d476d45f41d9c3e382fac9b5c0c0aaa5369b956
Reviewed-on: https://gerrit.instructure.com/5135
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Selenium <selenium@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-08-19 10:21:42 -06:00
Cody Cutrer 56069d8abe simplify permission policies for Course and Account
Basically, change from using recursive calls to a single flattened call.

Interestingly, this change caught a bug in the become user spec, so
apparently the old code wasn't quite working as intended.

Change-Id: I20fce8dbc5ca7c4797a4f8bd929202aaf8a96f9c
Reviewed-on: https://gerrit.instructure.com/5062
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Selenium <selenium@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-08-16 08:38:39 -06:00
Cody Cutrer 4db7bbad10 cinch up admin permissions wrt stuff available in the accounts section
Refs #4952

 * Fix saving role overrides for Site Admin account roles
 * Add the following permissions:
   * read_course_list (for listing or searching courses)
   * view_statistics (for viewing account statistics)
   * manage_user_notes (instead of being implied-ish by read_reports)
 * Hide UI elements that provide access to features that are not
   allowed
 * Remove lots of not applicable stuff from Site Admin settings

Change-Id: I7414368b472ba655d04118db30c1bb46542deb37
Reviewed-on: https://gerrit.instructure.com/5054
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-08-16 08:17:55 -06:00
Cody Cutrer 9c3e9f7c89 enforce course creation permissions fixes #5188
* Remove the show_create_course_button helper, and refactor into
   Account's set_policy block
 * Don't implicitly give any admin :manage_courses rights (since it
   can be revoked)
 * Check for the correct permission on the correct account in the
   GettingStartedController and CoursesController#copy

Change-Id: I6769d20c299d7e34ea83a79cdb6fab0d588122dc
Reviewed-on: https://gerrit.instructure.com/5027
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-08-15 16:10:48 -06:00
Cody Cutrer fdf20c81fd fix tab css classes for non-english
Change-Id: I2bc504505e1c8817467304c55571d77395464c18
Reviewed-on: https://gerrit.instructure.com/4980
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-08-08 09:20:19 -06:00
Cody Cutrer 57fc782552 hide Copy Course button for non-authorized users fixes #4882
Change-Id: I04b551f4d81158345807b1adca6dbbea8bb0ff90
Reviewed-on: https://gerrit.instructure.com/4952
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Selenium <selenium@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-08-05 12:26:37 -06:00
Zach Wily 11aca38df8 speed up loading sub-accounts as options
Change-Id: Icc5c4ef175ad86e6c13547861abb987d12176f8b
Reviewed-on: https://gerrit.instructure.com/4970
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-05 10:32:26 -06:00
Zach Wily 770e8aca86 fix i18n for default term name
The strategy is that if a term is named "Default Term", that will be a marker
that it's the default term in any language. When displaying the term name, we
check if it == "Default Term" and show the translated version if so. We also
do some special-casing on saving a new term name to make sure the translated
term name doesn't get saved as the new name.

Change-Id: Ic2b6659f75ef5e56bb5aa5fb7b241bba77dee445
Reviewed-on: https://gerrit.instructure.com/4905
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-03 11:20:39 -06:00
Jon Jensen 5e66286c14 locale detection and selection, refs #4994
Change-Id: I0f1e50d912ba7ac81b9ceb3ae95baaba3a12425b
Reviewed-on: https://gerrit.instructure.com/4661
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-07-20 09:24:55 -06:00
Zach Wily 5181980fd4 fix typo in account
Change-Id: Ic062e4af52d1ef159f10e13a73da73675b2e038a
Reviewed-on: https://gerrit.instructure.com/4728
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-19 15:08:52 -06:00
Zach Wily 4cf56a75b1 finish conversion of storage_quota to bytes from MB
At this point, nobody should be writing quotas as bytes anymore, so we mass
convert the remainder to bytes and get rid of the backwards-compatible code.

Change-Id: Ic5d6f8c8eaed947aef48dd7b1da348158f4ea2a4
Reviewed-on: https://gerrit.instructure.com/4276
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-07-19 09:28:59 -06:00
Brian Palmer 92feb2bcdb replace ActiveRecord::Base calls with subclass calls where it makes sense
This was already a small issue if the job queue was on a different
database driver than the main database, and it'll become more important
as more AR connections are introduced.

Change-Id: I204becadd32bb935df096e8c937a04bb6962f0b2
Reviewed-on: https://gerrit.instructure.com/4601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-18 13:56:08 -06:00
Cody Cutrer 7f5cc0693b optimize AdheresToPolicy
Basically, don't call a bazillion procs everytime you check_policy;
just the "given" statement.  Everything else is evaluated just once,
and cached on the class.  This does lose functionality (the ability
to access the instance inside of set_policy, and set methods), but
none of it was currently in use.

Change-Id: I736879d98beb4115a2e8c492931c755076291d08
Reviewed-on: https://gerrit.instructure.com/4665
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-07-14 13:25:28 -06:00
JT Olds 2592c8af14 i18n login_handle_name
Change-Id: Ib1ca0b327c5686ba6bc672053af6caabfe265bed
Reviewed-on: https://gerrit.instructure.com/4612
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-12 11:54:53 -06:00
Zach Wily 46ae1a6022 fix storing new quota
Change-Id: I1b6dd7fd14df2dd61d4579bfd33f61da23fb35a8
Reviewed-on: https://gerrit.instructure.com/4626
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-09 07:32:52 -06:00
Zach Wily 4124efb683 switch to storing quotas as bytes instead of MB
Change-Id: Ie1be93fbfe7b62b8400923506b6bb13150f1d81f
Reviewed-on: https://gerrit.instructure.com/4275
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-07-06 09:18:31 -06:00
Jon Jensen fba0c94e4a string extraction for most i18n oddities
Change-Id: Ibdf9315b6165269af2ee0c99a27093d5abc75641
Reviewed-on: https://gerrit.instructure.com/4509
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-06-30 16:48:12 -06:00
JT Olds 22944c904c don't require no-op block for Account#fast_course_base
Change-Id: Ibb3854f3162aeecbf568e04bef54e5394e046855
Reviewed-on: https://gerrit.instructure.com/4408
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-06-28 11:39:49 -06:00