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>
Fixes bug where:
ContentTag.all(:include => :content)
with one or more "tableless" content tags (such as ExternalUrl or
ContextModuleSubHeader), causes a deprecation notice:
activerecord-2.3.11/lib/active_record/association_preload.rb:336:
warning: Object#type is deprecated; use Object#class
Change-Id: If9153ce4b2ccb3f4ce740e51d1b72a49c035f0e2
Reviewed-on: https://gerrit.instructure.com/3737
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>