Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ---
- # Caching!
- # THIS METHOD IS NOT IDEAL and was probably a bad idea. if a list of teams is pre-loaded via sql,
- # this method will go to memcached anyway, which is dumb. haven't been able to find away
- # around it. rails doesn't seem happy about me overriding a has_many association method.
- # probably need to rename this to affiliations_cached or something like that, and use it explicitly
- # when needed. will fix when i have time. bugzID 702.
- # assuming that a team's primary affiliation, division, league,
- # conference, sport, and parent NEVER change,
- # and that affiliations themselves are NEVER updated.
- # if we ever need to reset these, then we can do so by updating Team's or Affiliation's
- # class-level version
- alias_method :uncached_affiliations, :affiliations
- def affiliations
- get_cache("affiliations:#{self.cache_config[:version]}:#{Affiliation.cache_config[:version]}") do
- uncached_affiliations
- end
- end
- # ---
Add Comment
Please, Sign In to add comment