Change-Id: I1ae439ac84c364b161b5a76ec43aa55661ca3fd9
Reviewed-on: https://gerrit.instructure.com/30169
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
active record::associations accepts an :include
parameter which automatically retrieves specified
associations of the associated model.
In rails 2, AR checks through the where clause and
joins the table if it is referenced in the where
clause. In rails 3, this parameter is ignored when
specifying a condition on the association (and also
when you call pluck, incidentally), resulting in
database errors when you e.g.
has_many enrollments, include: [:course], :conditions
=> "courses.some_property = 'some value'"
this commit adds support for using an inner join with
these associations (it is not enough to simply define
a method on the model to retrieve the association with
the given conditions, because the associations in
question are referenced in a few has_many_through
associations later)
note this does not add similar support for inner joins on
associations in rails2, so we are still using the
:include option. This is a bit of an antipattern
as it can result in something of an N+1 queries
problem. This commit doesn't address that; it simply
makes the rails 3 postgres adapter less upset with us.
Change-Id: I5beefd689c734d372ed5627fef4bbb450883837d
Reviewed-on: https://gerrit.instructure.com/30185
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
refs CNVS-9522
replace our hokey ActiveRecord::Base.suspend_callbacks implementation
with something that integrates nicely with ActiveSupport::Callbacks in
general, as a gem.
include it into ActiveRecord::Base and use it to implement
save_without_callbacks for rails3 (rails2 still needs to do it the way
we had it before, because the notifications callback isn't handled
through ActiveSupport::Callbacks).
test-plan:
- make sure ActiveRecord callbacks still run in most cases (e.g. after
creating a course through the UI, it should have a value in the uuid
column in the database)
- make sure callbacks don't run while suspended (e.g. have a user
enrolled in two courses. call user.delete_enrollments. both
enrollments should be deleted, but only one delayed job for due date
caching should be created)
Change-Id: Iecd1cc0346e218261677d16ee44bae9cb9149ddd
Reviewed-on: https://gerrit.instructure.com/29809
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
This commit namespaces the rest of quiz related code into a Quizzes
namespace: controllers, views, models, and classes that previously lived
under lib/ that are Quiz-related.
Test plan:
Full regression test on all quiz related items
refs CNVS-10457
Change-Id: If54b61213945056539e03271a936d233abb66188
Reviewed-on: https://gerrit.instructure.com/29351
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
fixes CNVS-11066
test plan
=========
- navigate to screenreader gradebook and select an assignment
- click the "Message Students Who..." button
- verify that the dialog is styled the same as the one for the same
assignment in GB2
Change-Id: I6006c31047f0fe3dcc6ab8289b983a2ca1713dd4
Reviewed-on: https://gerrit.instructure.com/30057
Reviewed-by: Matthew Irish <mirish@instructure.com>
Product-Review: Matthew Irish <mirish@instructure.com>
QA-Review: Matthew Irish <mirish@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
- i18n's everything
- shuffles content a bit
- adds some styling
- added empty states for the various sections rather than just hiding them
- also removes jquery patch that adds "disabled" class when disabling an
element
closes CNVS-9390
test plan
=========
the layout should look nicer
tests should still pass
general regression tests of srgb
Change-Id: Iba2c0239d2e0312e26225652190c5280120598fd
Reviewed-on: https://gerrit.instructure.com/29845
Reviewed-by: Matthew Irish <mirish@instructure.com>
Product-Review: Matthew Irish <mirish@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
things fixed:
- erubis is in actionpack gemspec in rails3, so we don't need it in the gemfile
- don't directly initialize a SafeBuffer, and instead initialize OutputBuffer
- Fix comparison of hash with indifferent access in quizzes spec
- plugins in rails3 aren't loaded in init.rb so rails_xss is still being
loaded in rails3. However we have parts of the code that actually reference
rails_xss classes directly so we want to keep the RailsXss::Erubis constant
defined in erubis.rb. However we don't want to actually monkey patch
the activesupport or string methods anymore for xss (rails3 takes care of
this for us)
Change-Id: I327bf042dfa7dcedd39acb463eda1420d3dbd98c
Reviewed-on: https://gerrit.instructure.com/30108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
This logs the STAT line in the same format as for web requests, though
omitting the @@last_sample at the end.
Rather than implementing it directly in worker.rb, I pulled in the new
Lifecycle callback code that delayed_job added after we forked, and
added the logging as an around filter in our canvas initializer.
Eventually I'd like to pull the other canvas-specific code into
lifecycle callbacks as well, making delayed_job more generic and
extractable.
test plan: run jobs, and verify that they still complete successfully,
and log a STAT line at the end with information on cpu and memory usage.
Change-Id: I18e17b286f5df8aa3c9774f0ac92841f4b92e193
Reviewed-on: https://gerrit.instructure.com/30037
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
This matches the behavior of the rails2 sharding stuff. Specifically,
it doesn't fail when the return value of the block is true
Change-Id: I3f165d8c896bc038bf57908356b15c06dd76591b
Reviewed-on: https://gerrit.instructure.com/30081
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Change-Id: I6f0b7bfc5ab9d9c73287e8b51f522406133a9091
Reviewed-on: https://gerrit.instructure.com/30041
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
also fix with_each_shard
Change-Id: Ideb8371e3e36059aeca8ca1b756ca9e9188f1116
Reviewed-on: https://gerrit.instructure.com/29978
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
'<% link_to' to '<%= link_to'
Change-Id: I71fa45f9c59ce7cc685bc05242f4f22750ab43a6
Reviewed-on: https://gerrit.instructure.com/30014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fixes CNVS-10347
test plan:
general regression test of assignment edit page with draft state on and
off.
general regression test of discussion edit page.
Change-Id: I54e75f55f8acc604998e36c879d98b8a1176c817
Reviewed-on: https://gerrit.instructure.com/28714
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Change-Id: Iee742e19c2c87b914b4d2e5bc8994cd6ea2527fc
Reviewed-on: https://gerrit.instructure.com/29951
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
* don't use respond_to if json is the only possible format
* when filtering scribd_doc, rails 3 serializes as a hash with
string keys, as opposed to a HashWithIndifferentAccess, so
delete with string key
* don't use StringIO as an uploaded file; Rails 3 TestCase will
call to_param on it
* don't require the .:format part of the public_url route
Change-Id: I282f529f1ee0941b52a996eefa01647a018f70d3
Reviewed-on: https://gerrit.instructure.com/29930
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>
test plan:
- have a user enrolled in >10 courses
- hit the /api/v1/courses endpoint as this user
- verify that only the first 10 courses are returned
- verify that you can use ?page=2 to get the next page
of results
fixes CNVS-10763
Change-Id: I1eae1a46d5c7b049fa19af6a802ab4d9fa499d2b
Reviewed-on: https://gerrit.instructure.com/29542
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Change-Id: I783618bc5457ea53a9d59ab36d3ccf7b7fde7b2e
Reviewed-on: https://gerrit.instructure.com/29595
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: I9627b75a5473044f9902a5e171a79d4446772ed7
Reviewed-on: https://gerrit.instructure.com/29572
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: Ie26c2eb56d1e29c1108f13d9ef8d7773e908a298
Reviewed-on: https://gerrit.instructure.com/29606
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
refs CNVS-9546
for rails2, when using multiple environment-conditioned caches,
middleware must be inserted for each cache. so we need to instantiate
them and manage the middleware at boot. adjust accordingly
for rails3, we're using switchman and switchman has been updated to
manage this for us. we just need to give it the full cache configuration
map up front.
also changes the default for Canvas.cache_store_config's second
parameter to true, extracting the nil_is_nil=false behavior into the
fallback value for Rails.env in the new Canvas.cache_stores method. the
only remaining callers of this method are in some plugins which passed
an explicit true value for that parameter. once those plugins are
updated to access Canvas.cache_stores directly,
Canvas.cache_store_config will be removed.
Change-Id: I80eb09679303f2778a6ddc9ab476e695a6754465
Reviewed-on: https://gerrit.instructure.com/28441
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Change-Id: I86bde6da2cc006e92c00113dccb95f100c2dadee
Reviewed-on: https://gerrit.instructure.com/29393
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: I926d13c5ce839e7236d8e2c7720be01e5e044eea
Reviewed-on: https://gerrit.instructure.com/29530
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: I746004e5d6ab6ac0a4d7d557a799f878c0a84501
Reviewed-on: https://gerrit.instructure.com/29401
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: Ic533c19fb4c54ca3de2acb4265b2d884036e28f6
Reviewed-on: https://gerrit.instructure.com/29442
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
* vendoring gems to allow the gems that we own to reference a locked
* down version in their gemspecs. Specifically, with the old version of
* ActiveSupport that we were getting from the LTS Rails repo, there is
* no way to tell bundler to install a gem that is a subdirectory of a
* git repo.
Change-Id: I32d9d0fae15da1fcf27f11e5cd8fca26af18d383
Signed-off-by: David Julia <djulia@pivotallabs.com>
Reviewed-on: https://gerrit.instructure.com/29438
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
Change-Id: Iff18c336743dfe3492337bdf576ccec145b9e375
Reviewed-on: https://gerrit.instructure.com/29256
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: Ic853af26b6f1722c80e45319e46f296f48aa926d
Reviewed-on: https://gerrit.instructure.com/29435
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: I9637715c285890404d22d1f78c07def3ca7930e1
Reviewed-on: https://gerrit.instructure.com/29271
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>