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 CHANGED
@@ -1,4 +1,4 @@
1
- # rate_limiter
1
+ # Rate Limiter
2
2
 
3
3
  A gem that limits the rate at which ActiveRecord model instances can be created.
4
4
 
@@ -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} =? AND created_at >= ?", self.send(klass.rate_limit_on), Time.now - klass.rate_limit_interval)
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.
@@ -1,3 +1,3 @@
1
1
  module RateLimiter
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rate_limiter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: