requests_counter 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,5 @@
1
+ = Version 0.1.6
2
+ * Lil fix 4 Rails 3.1
1
3
  = Version 0.1.5
2
4
  * Added initializers
3
5
  = Version 0.1.0
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('requests_counter', '0.1.5') do |p|
5
+ Echoe.new('requests_counter', '0.1.6') do |p|
6
6
  p.description = "Requests Counter allows you to count attemps to get resource. You can then decide if attemp should be stopped (banned)."
7
7
  p.url = "https://github.com/mensfeld/Requests-Counter"
8
8
  p.author = "Maciej Mensfeld"
@@ -16,11 +16,11 @@ class RequestsCounter < ActiveRecord::Base
16
16
 
17
17
  # Searches for instance element with provided token and resource
18
18
  # and if it does not find one - will create new and return it to us
19
- def self.with_token(token, resource = nil, params = {})
20
- unless el = self.where(:token => token, :resource => resource).first
19
+ def self.with_token(token, target = nil, params = {})
20
+ unless el = self.where(:token => token.to_s, :resource => target.to_s).first
21
21
  el = self.create({
22
- :token => token,
23
- :resource => resource
22
+ :token => token.to_s,
23
+ :resource => target.to_s
24
24
  }.merge(params))
25
25
  end
26
26
  el
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{requests_counter}
5
- s.version = "0.1.5"
5
+ s.version = "0.1.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Maciej Mensfeld"]
9
9
  s.cert_chain = ["/home/mencio/.cert_keys/gem-public_cert.pem"]
10
- s.date = %q{2011-06-01}
10
+ s.date = %q{2011-06-10}
11
11
  s.description = %q{Requests Counter allows you to count attemps to get resource. You can then decide if attemp should be stopped (banned).}
12
12
  s.email = %q{maciej@mensfeld.pl}
13
13
  s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md", "lib/generators/my_requests_counter/install_generator.rb", "lib/generators/my_requests_counter/templates/create_requests_counters_migration.rb", "lib/generators/my_requests_counter/templates/requests_counter_init.rb", "lib/requests_counter.rb"]
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: requests_counter
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.5
5
+ version: 0.1.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Maciej Mensfeld
@@ -31,7 +31,7 @@ cert_chain:
31
31
  BH3YFsdk
32
32
  -----END CERTIFICATE-----
33
33
 
34
- date: 2011-06-01 00:00:00 +02:00
34
+ date: 2011-06-10 00:00:00 +02:00
35
35
  default_executable:
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file