Commit Graph

3 Commits

Author SHA1 Message Date
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
Brandon Turner 23cc3e8b2a fixed deprecation notice when including content with content tags
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>
2011-05-24 10:28:42 -06:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00