aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/history.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-11-30 22:48:13 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-11-30 22:48:13 +0000
commit45ae88e9087e87852f76bfbd62bcf6e66500da70 (patch)
tree2925d9aa72aaf5bdcfa57ee358e6237f831026eb /lib/mauve/history.rb
parent494de72e43b0f294aed3b5006b0793ae3ab8a545 (diff)
Improved logic in the events calendar -- should be faster now.
Diffstat (limited to 'lib/mauve/history.rb')
-rw-r--r--lib/mauve/history.rb33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/mauve/history.rb b/lib/mauve/history.rb
index 1e683d2..674099f 100644
--- a/lib/mauve/history.rb
+++ b/lib/mauve/history.rb
@@ -116,39 +116,6 @@ module Mauve
public
- # This adds an alert or an array of alerts to the cache of alerts
- # associated with this model.
- #
- # Blasted datamapper not eager-loading my model.
- #
- # @param [Array or Alert] a Array of Alerts or a single Alert
- # @raise ArgumentError If +a+ is not an Array or an Alert
- def add_to_cached_alerts(a)
- @cached_alerts ||= []
- if a.is_a?(Array) and a.all?{|m| m.is_a?(Alert)}
- @cached_alerts += a
- elsif a.is_a?(Alert)
- @cached_alerts << a
- else
- raise ArgumentError, "#{a.inspect} not an Alert"
- end
- end
-
- # Find all the alerts for this History. This caches the alerts found.
- # Call #reload to get rid of the cache.
- #
- # @return [Array] Alerts
- def alerts
- @cached_alerts ||= super
- end
-
- # Reload the object, and clear the cache.
- #
- def reload
- @cached_alerts = nil
- super
- end
-
# @return Log4r::Logger
def logger
Log4r::Logger.new self.class.to_s