Commit Graph

43 Commits

Author SHA1 Message Date
Jacob Burroughs 7dcc507d0a Rubocop for ruby 3.1
[skip-stages=Flakey]

Change-Id: I6abefdfa9fed6dd4525c8786e93efa548b3710f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-06-06 16:44:26 +00:00
Aaron Ogata 9c0413c2b2 fix as_json method signature for ruby 3.x
refs AE-92

Change-Id: I84c97922308d4c3ebf404e8942b24fbf4885bd6d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307218
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-12-12 20:58:00 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer ff99d18138 RuboCop: Style/RedundantSelf
[skip-stages=Flakey]

auto-corrected

Change-Id: I5f26ad1f8210a74c2198b514235d5134dcd0dae1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279070
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-11-20 16:41:21 +00:00
Cody Cutrer 196d92d5d3 RuboCop: Rails/Validation
auto-corrected

Change-Id: Ic0cae5ea88556acc456499b4a466a36e9151a5c6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278365
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 16:48:43 +00:00
Cody Cutrer fd6b50710c RuboCop: Style/CaseLikeIf
[skip-stages=Flakey]

auto-corrected

Change-Id: I1f6b8a5f58a97a3ef17004ba9bf7a0940632dd55
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278161
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-12 20:24:23 +00:00
Cody Cutrer c2be81fc42 RuboCop: Style/EmptyCaseCondition
some auto, some manual if there was a better fitting construct than
an if/elsif/else

Change-Id: Ifee268f80d411b7b4c98a024c209d2014c7d0c9f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277998
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 21:58:23 +00:00
Cody Cutrer aee91b708e RuboCop: Lint/UnusedMethodArgument app/models
all manual

several instances I noticed that the entire method was unused, so removed it

Change-Id: I14ffe7d4b6966ee790e32410f1dbaf5b26ea7f21
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276513
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-27 15:55:26 +00:00
Cody Cutrer b973c7ca27 RuboCop: Style/ParenthesesAroundCondition
[skip-stages=Flakey]

(auto-corrected)

this complements Lint/AssignmentInCondition

Change-Id: I8e621631cb8565cc6062398cfab714f61b485cad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274747
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-30 12:59:18 +00:00
Cody Cutrer f5cdb0d986 RuboCop: Layout app/models
Change-Id: Ieae2904fb81739476d806b01bd7b4ff98c5ee35c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 19:32:32 +00:00
Cody Cutrer f299f76b75 add # frozen_string_literal: true for models
Change-Id: I70825be7ec7e24458afe0c63dc48c5a76158f520
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-28 22:08:12 +00:00
Rob Orton e63627c74c add workflow_state to account_users
fixes CNVS-38231

test plan
 - delete an admin
 - admin should be gone from every where
 - admin should not have permissions to do stuff

Change-Id: I56c90a12b2be879c5d646c1ab6980693ff161673
Reviewed-on: https://gerrit.instructure.com/119220
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Tested-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-08-01 18:31:37 +00:00
Landon Wilkins c7e07671c0 da licença part 8
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I47bbff536d1c515a3d5482abc8d635efa040eeaf
Reviewed-on: https://gerrit.instructure.com/110028
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:33:20 +00:00
Cody Cutrer ce21af8ecf rails 5: find and fix lots of deprecation warnings [ci verbose]
refs CNVS-34843

Change-Id: Idd523c2a7c37325381d590f1ee70c406ace2a459
Reviewed-on: https://gerrit.instructure.com/105033
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-16 16:03:51 +00:00
James Williams 89370c5f11 remove protected_attributes
refs #CNVS-32574

Change-Id: I3ba018a7110a7530c9af4a59c97422f626a749b6
Reviewed-on: https://gerrit.instructure.com/99260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-12 17:46:18 +00:00
James Williams 440daa4a87 use strong params, part A
refs #CNVS-32574

Change-Id: I2785c562c33980a7e230296c200538b8bb0ca6b5
Reviewed-on: https://gerrit.instructure.com/92728
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-10-14 16:17:26 +00:00
Cody Cutrer fb64908614 expand "native" polymorphic associations to most polymorphics
Change-Id: I0b2ada85ae6d7b32d2940f5c7db6596b27c3bf84
Reviewed-on: https://gerrit.instructure.com/72282
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-22 19:14:31 +00:00
Michael Nomitch 757d9202d8 remove unused constants from canvas models
fixes CNVS-26220

test plan:
  - none

Change-Id: I40e675550e25a8c88795a4ddcd0d05e8470ada69
Reviewed-on: https://gerrit.instructure.com/69752
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
2016-01-12 17:39:22 +00:00
Simon Williams c245f0c461 fix a syntax error with alerts looking up account roles
fixes CNVS-20097

test plan:
- enable account alerts in account settings
- enroll a teacher in a course
- make sure the teacher has a verified email address
- visit the teacher's notification preferences page to make sure there
  is a notification policy set up for the alert notification.
  confusingly, this is not the same as the "Alert" section on the page,
  this notification policy actually cannot be customized, but visiting the
  page will create it if it doesn't already exist.
- the annoying thing about this alert notification policy is setup is
  that it is set up to be a 'daily' policy, and it can't be customized.
  this means that even after the job runs and creates the message
  successfully, it won't actually be sent until the following daily batch.
  to fix this for testing, you can make the notification policy immediate
  by running the following in a rails console:
    ```
    NotificationPolicy.
      where(:notification_id => Notification.by_name("Alert")).
      update_all(:frequency => "immediately")
    ```
- now set up any alert and trigger the conditions for the alert
- alert messages are only computed once per day at 11:30 utc. since
  this is an inconvenient time to have a patchset checked out, the
  easiest way to make this happen manually is to run the following in
  a rails conosle:
    `Alerts::DelayedAlertSender.process`
  however, be aware that this job sets a redis key after it runs to make
  sure notifications don't get sent twice to the same person, so if you do
  need to run it twice in one day for some reason, clear redis between runs.
- the alert message should be sent.  if you set up a real email address
  you should receive the message, or you can check that it was sent by using
  the "View Notifications" tab in the admin tools section of the account.

Change-Id: I213625d6cd3c3f46d33f168980884b2ba1bb0974
Reviewed-on: https://gerrit.instructure.com/53092
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-05-04 22:11:40 +00:00
James Williams 81d4adc319 new roles
refactor everything that used to use strings for roles
to use actual role_ids

the apis should be backwards compatible so we don't need
to update (most of) the UI's right away in this commit

test plan:
* regression tests for permissions, role overrides,
 alerts (for account roles), enrolling users,
 adding account admins, etc.

refs #CNVS-15481

Change-Id: Id57fd3104c5c518b6fbf180609950dcddcdd474d
Reviewed-on: https://gerrit.instructure.com/41208
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-10-31 19:44:14 +00:00
Braden Anderson 45d19f3003 validate types on polymorphic associations
fixes ALYT-26

test plan:
	* regression test

Change-Id: Ie93e89b842e354f1f76d75f3492145b86c79a035
Reviewed-on: https://gerrit.instructure.com/34560
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-05-28 17:05:34 +00:00
Anthus Williams 828981e72c define exportable attributes/associations on models
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run

Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-05-06 23:54:24 +00:00
Nathan Mills bb244d1f86 move all DelayedJob Alert code into separate class
fixes CNVS-12411

test-plan:
regression test all alerts

Change-Id: Ie954c3c6c3f034fce130774c5c6e4e1515b02049
Reviewed-on: https://gerrit.instructure.com/33339
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:55 +00:00
Joseph Rodriguez 339dc7a41f Refactor alert creation to remove unnecessary code
fixes CNVS-12410

test plan:
regression test alert notifications

Change-Id: I3f20a532b0ee39ce2b9e136145f8c7f5f0bc0ba6
Reviewed-on: https://gerrit.instructure.com/33313
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:42 +00:00
Joseph Rodriguez 40dcaa4681 refactor Alert::UserNote to check enable_user_notes on account
fixes CNVS-12406

test plan
regression test alerts sent based on user notes and the enable user
notes accout setting

Change-Id: I9627c7db5381be282f6ed9134aee2f44fef76720
Reviewed-on: https://gerrit.instructure.com/33306
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:33 +00:00
Joseph Rodriguez 2533ddc54c extract interaction alert check to it's own class
fixes CNVS-12405

test plan:
regression test alerts sent out based on Submission Comments and
Conversation Messages

Change-Id: Ibd145fe07b7c23180bf855afa96c1d4e47459409
Reviewed-on: https://gerrit.instructure.com/33300
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:23 +00:00
Nathan Mills 99ef8ef712 extract user note alert check to it's own class
fixes CNVS-12402

    test-plan:
    regression check user note alerts for timespan threshold

Change-Id: I33abc799d7c34185aba15e62387eedee9b1acaf6
Reviewed-on: https://gerrit.instructure.com/33295
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:13 +00:00
Nathan Mills 1088ca732b extract ungraded timespan alert check to it's own class
fixes CNVS-12393

test-plan:
regression check ungraded submission alerts for timespan threshold

Change-Id: I228c2e152d20a61871a483974e5a418a9b61e56d
Reviewed-on: https://gerrit.instructure.com/33287
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:48:01 +00:00
Nathan Mills f3e4a898ba move ungraded count checking to it's own class
fixes CNVS-12392

test plan:
regression test on alerts for ungraded assignments

Change-Id: I0ee553666706e91a96b953b1796578b834fd88b7
Reviewed-on: https://gerrit.instructure.com/33284
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:47:41 +00:00
Nathan Mills 8002734889 extract student to teacher mapping
fixes CNVS-12370

test plan:
course alerts should still work

Change-Id: I877f27506e1c8f5c89de77c266018824b7f5045e
Reviewed-on: https://gerrit.instructure.com/33252
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:47:31 +00:00
Nathan Mills a891bdeca5 make evaluate_for_course arguments required
fixes CNVS-12343

test plan:
alerts for a course should still get sent

Change-Id: I149f72e5604c3d83a6a4aa63f2adcea5325ae9f5
Reviewed-on: https://gerrit.instructure.com/33220
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-02 21:47:22 +00:00
Andrew Leung 0cf0d1bb3e Fix bug that causes alerts to affect other courses
Previously, alerts_cache is modified when evaluate_for_course is called.
If the course being evaluated has alerts, they will be incorrectly added
to alerts_cache for that course's account. All subsequent courses in the
same account will see them as account alerts when evaluated, even though
they were only meant for that one course.

Test Plan:
  * Create two courses in the same account
  * Set up an alert in the first course
  * Create the circumstances that meet the criterion in both courses
  * Confirm that the alert is only triggered in the first course
2014-04-03 17:50:02 -07:00
Cody Cutrer 7d77f2f31b fix alerts on rails 3
Change-Id: If8a9296f5d6d6c85dd7caf4af12dac5b4654065a
Reviewed-on: https://gerrit.instructure.com/31404
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-03-06 15:24:15 +00:00
Jacob Fugal dfab0425e3 use CANVAS_RAILS2 for conditionals
rather than CANVAS_RAILS3 or Rails.version

this is to be consistent, and to reinforce that any "special" branches
are for rails 2.3 backwards compatibility while trying to target rails
3, rather than rails 3 "forwards compatibility".

Change-Id: I4494b65e3f71108a43d09032c1569c478646a828
Reviewed-on: https://gerrit.instructure.com/24998
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-10-10 15:58:43 +00:00
Cody Cutrer 2deb504378 useful find_each
* automatically does with_exclusive_scope
 * if the scope has an order or group by, use an alternate
   implementation so it's not broken
 * alternate methods are cursors (postresql only) or temporary
   tables. if a transaction is already open, or we're on a slave,
   prefer a cursor (even over the normal method, since the query
   might be slow even without an order or group by)

test plan:
 * migrations should still work (especially data fixups)
 * lots of account reports use find_each; make sure they still run

Change-Id: If876b7b3401e6cda1d41f1c94b93af4810b78cf4
Reviewed-on: https://gerrit.instructure.com/22364
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-07-18 22:26:46 +00:00
Cody Cutrer d9111f5414 arel-ify models
closes CNVS-4707

Change-Id: I32c8ec5a53525f89cf232890eaac790fbc2b4744
Reviewed-on: https://gerrit.instructure.com/18745
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 18:42:38 +00:00
Cody Cutrer 7b8dd548d3 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>
2012-08-21 13:49:23 -06:00
Jon Jensen f63077aa7f cache notifications in memory
test plan:
* use canvas and ensure that notifications work

Change-Id: Ie46f049aab5dde7167c3ea4228e503c7a686c839
Reviewed-on: https://gerrit.instructure.com/9154
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-03-05 14:49:27 -07:00
Jacob Fugal 317378f775 straighten out course designer permissions
fixes #6194

test-plan:
  - create a course
  - create a user
  - add the user to the course as a designer
    (course.add_designer(user).accept in script/console)
  - the user should be able to do almost everything a teacher can in the
    course
  - the user should *not* be able to view grades or user notes
  - the user should *not* be included in the course roster

Change-Id: Id0e642fb19906529627917fffac26f0dae378bcc
Reviewed-on: https://gerrit.instructure.com/8047
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>
2012-01-13 18:56:50 -07:00
JT Olds f9a8f32164 api json conversion improvements
* adds course url to course record
 * adds avatar url to users record more globally

test plan: make api calls that return courses or users, ensure they still work

Change-Id: I1db69fe3865a39744ba7f3fcc7fc885f46c6551b
Reviewed-on: https://gerrit.instructure.com/7496
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-01-03 15:09:20 -07:00
Zach Pendleton 3ca0c208c9 fix spelling of "privileges" in enrollments.
enrollments previously had attribute
"limit_priveleges_to_course_section," but should
be spelled "privileges." replaced spelling in a
migration and across app.

affects: enrollments model
test plan:
  * run specs

Change-Id: I15dcf9a023ead9bb1aed42abc2d1a7c233610840
Reviewed-on: https://gerrit.instructure.com/7431
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-19 16:48:42 -07: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