From ac3abcf08b444c7aab92e6d5863904a3fc72bafd Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 29 Jul 2010 20:17:36 +0300 Subject: [PATCH] improved Redistat::Database --- lib/redistat/database.rb | 6 +++--- lib/redistat/event.rb | 1 - lib/redistat/summary.rb | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) 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 ||= {}