active_interaction 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe823793d930b947cf93fb8c5e9653b7bcd63e49
|
4
|
+
data.tar.gz: 9bfec14c2454c235e20e1ab347c927680ddb7101
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f469a6ed3d1efa8afab46b59a2c1c910ce4fa0a089524d892f04da1c9e7a17a8450a49d3c445f16c19a9df228606271fde3a33ab0cdf4049cc00eca2612e544c
|
7
|
+
data.tar.gz: 1abe93f04ed2ff447e0a36189b41386e98bfbf9abeb4f19d5a849aae461a0becf5c141be7464d88511031a225010a9cf96facb9d0145002ce5abd654d26fe6dc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# [Master][]
|
2
|
+
|
3
|
+
# [0.2.2][] (2013-08-07)
|
4
|
+
|
5
|
+
- Fix support for `ActiveSupport::TimeWithZone`.
|
6
|
+
|
1
7
|
# [0.2.1][] (2013-08-06)
|
2
8
|
|
3
9
|
- Fix setting a default value on more than one attribute at a time.
|
@@ -27,6 +33,8 @@
|
|
27
33
|
|
28
34
|
- Initial release.
|
29
35
|
|
36
|
+
[master]: https://github.com/orgsync/active_interaction/compare/v0.2.2...master
|
37
|
+
[0.2.2]: https://github.com/orgsync/active_interaction/compare/v0.2.1...v0.2.2
|
30
38
|
[0.2.1]: https://github.com/orgsync/active_interaction/compare/v0.2.0...v0.2.1
|
31
39
|
[0.2.0]: https://github.com/orgsync/active_interaction/compare/v0.1.3...v0.2.0
|
32
40
|
[0.1.3]: https://github.com/orgsync/active_interaction/compare/v0.1.2...v0.1.3
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ module ActiveInteraction
|
|
25
25
|
when Numeric
|
26
26
|
time.at(value)
|
27
27
|
else
|
28
|
-
super(key, value, options.merge(class:
|
28
|
+
super(key, value, options.merge(class: time_class), &block)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -37,5 +37,10 @@ module ActiveInteraction
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
private_class_method :time
|
40
|
+
|
41
|
+
def self.time_class
|
42
|
+
time.at(0).class
|
43
|
+
end
|
44
|
+
private_class_method :time_class
|
40
45
|
end
|
41
46
|
end
|
@@ -1,5 +1,47 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
class TimeZone
|
4
|
+
def self.at(*args)
|
5
|
+
TimeWithZone.at(*args)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class TimeWithZone
|
10
|
+
def self.at(*args)
|
11
|
+
self.new(Time.at(*args))
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize(time)
|
15
|
+
@time = time
|
16
|
+
end
|
17
|
+
|
18
|
+
def ==(time)
|
19
|
+
@time == time
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class TimeInteraction < ActiveInteraction::Base
|
24
|
+
time :a
|
25
|
+
|
26
|
+
def execute
|
27
|
+
a
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe TimeInteraction do
|
32
|
+
include_context 'interactions'
|
4
33
|
it_behaves_like 'an interaction', :time, -> { Time.now }
|
34
|
+
|
35
|
+
context 'with a time zone' do
|
36
|
+
let(:a) { rand(1 << 16) }
|
37
|
+
|
38
|
+
before do
|
39
|
+
allow(Time).to receive(:zone).and_return(TimeZone)
|
40
|
+
options.merge!(a: a)
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'returns the correct value' do
|
44
|
+
expect(result).to eq Time.at(a)
|
45
|
+
end
|
46
|
+
end
|
5
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_interaction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Lasseigne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
version: '0'
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.0.
|
221
|
+
rubygems_version: 2.0.6
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Manage application specific business logic.
|