allowed 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/allowed/limit.rb +1 -0
- data/spec/lib/allowed/limit_spec.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7af153f66450cb6df34f81701dc3cd967bdc51c4
|
4
|
+
data.tar.gz: 2b0899d05b5a3dfa6d3166631eab8299548aaca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b33a0f054d66a70805b00e562a4784048089cdba366e5b9e5c78af2c82aa40550cb477ae99a49f8c82f98a655b6082de375b569a9b3aa3433c5ec4476d381a3
|
7
|
+
data.tar.gz: d8dd767fa5548e1fccad3f5f9c629ec63923c8ce399e673318dcda48002a3280c45c04665f71f78222713fc019fa7079e1767b75dbdf050957a07b9e508c5930
|
data/lib/allowed/limit.rb
CHANGED
@@ -36,6 +36,7 @@ describe Allowed::Limit, "#allow" do
|
|
36
36
|
it "only calls validation callback on create" do
|
37
37
|
instance = subject.new
|
38
38
|
instance.stubs(:validate_throttles)
|
39
|
+
instance.stubs(:handle_throttles)
|
39
40
|
|
40
41
|
instance.save
|
41
42
|
instance.save
|
@@ -48,6 +49,12 @@ describe Allowed::Limit, "#allow" do
|
|
48
49
|
|
49
50
|
expect(subject).to have_callback(:rollback, :handle_throttles, kind: :after, on: :create)
|
50
51
|
end
|
52
|
+
|
53
|
+
it "adds after validation callback" do
|
54
|
+
subject.allow(limit, options)
|
55
|
+
|
56
|
+
expect(subject).to have_callback(:validation, :handle_throttles, kind: :after, on: :create)
|
57
|
+
end
|
51
58
|
end
|
52
59
|
|
53
60
|
describe Allowed::Limit, "#handle_throttles" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allowed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Dunn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
146
|
rubyforge_project:
|
147
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.2.2
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Throttling of ActiveRecord model creations.
|