cia 0.2.1 → 0.2.2
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.
- data/Gemfile.lock +1 -1
- data/MIGRATION.rb +2 -2
- data/gemfiles/rails2.gemfile.lock +1 -1
- data/gemfiles/rails3.gemfile.lock +1 -1
- data/lib/cia/attribute_change.rb +4 -0
- data/lib/cia/version.rb +1 -1
- data/spec/cia/attribute_change_spec.rb +9 -0
- data/spec/spec_helper.rb +2 -2
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/MIGRATION.rb
CHANGED
data/lib/cia/attribute_change.rb
CHANGED
data/lib/cia/version.rb
CHANGED
@@ -10,9 +10,18 @@ describe CIA::AttributeChange do
|
|
10
10
|
|
11
11
|
describe ".previous" do
|
12
12
|
it "finds by id desc" do
|
13
|
+
CIA::AttributeChange.delete_all
|
13
14
|
a = create_change
|
14
15
|
b = create_change
|
15
16
|
CIA::AttributeChange.previous.should == [b,a]
|
16
17
|
end
|
17
18
|
end
|
19
|
+
|
20
|
+
describe ".on_attribute" do
|
21
|
+
it "finds with attribute" do
|
22
|
+
a = create_change :attribute_name => :xxx
|
23
|
+
b = create_change :attribute_name => :yyy
|
24
|
+
CIA::AttributeChange.on_attribute(:xxx).all.should == [a]
|
25
|
+
end
|
26
|
+
end
|
18
27
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -55,7 +55,7 @@ def create_event
|
|
55
55
|
CIA::UpdateEvent.create!(:source => Car.create!, :transaction => transaction)
|
56
56
|
end
|
57
57
|
|
58
|
-
def create_change
|
58
|
+
def create_change(options={})
|
59
59
|
event = create_event
|
60
|
-
CIA::AttributeChange.create!(:event => event, :source => event.source, :attribute_name => "bar")
|
60
|
+
CIA::AttributeChange.create!({:event => event, :source => event.source, :attribute_name => "bar"}.merge(options))
|
61
61
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: michael@grosser.it
|
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
59
|
version: '0'
|
60
60
|
segments:
|
61
61
|
- 0
|
62
|
-
hash:
|
62
|
+
hash: -3438842526212601421
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
segments:
|
70
70
|
- 0
|
71
|
-
hash:
|
71
|
+
hash: -3438842526212601421
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
74
|
rubygems_version: 1.8.24
|