diff --git a/lib/redistat/database.rb b/lib/redistat/database.rb index 2d8517c..fee7f39 100644 --- a/lib/redistat/database.rb +++ b/lib/redistat/database.rb @@ -1,9 +1,9 @@ module Redistat module Database - def db - Redistat.redis + def self.included(base) + base.extend(Database) end - def self.db + def db Redistat.redis end end diff --git a/lib/redistat/event.rb b/lib/redistat/event.rb index 4a61fe1..9b55933 100644 --- a/lib/redistat/event.rb +++ b/lib/redistat/event.rb @@ -1,7 +1,6 @@ module Redistat class Event include Database - extend Database attr_reader :id attr_reader :key diff --git a/lib/redistat/summary.rb b/lib/redistat/summary.rb index fe788f8..a538148 100644 --- a/lib/redistat/summary.rb +++ b/lib/redistat/summary.rb @@ -1,7 +1,6 @@ module Redistat class Summary include Database - extend Database def self.update_all(key, stats = {}, depth_limit = nil) stats ||= {}