rate_limiter 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/rate_limiter/model.rb +1 -1
- data/lib/rate_limiter/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
data/lib/rate_limiter/model.rb
CHANGED
@@ -29,7 +29,7 @@ module RateLimiter
|
|
29
29
|
if rate_limit?
|
30
30
|
klass = self.class
|
31
31
|
|
32
|
-
others = klass.where("#{klass.rate_limit_on}
|
32
|
+
others = klass.where("#{klass.rate_limit_on.to_s} = ? AND #{RateLimiter.config.timestamp_field.to_s} >= ?", self.send(klass.rate_limit_on), Time.now - klass.rate_limit_interval)
|
33
33
|
|
34
34
|
if others.present?
|
35
35
|
# TODO: Come up with a better error message.
|
data/lib/rate_limiter/version.rb
CHANGED