legacy_migrations 0.2.2 → 0.2.3

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{legacy_migrations}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bernie Telles"]
@@ -27,7 +27,7 @@ module LegacyMigrations
27
27
  @operations ||= []
28
28
  @operations.select do |operation|
29
29
  result = true
30
- args.each do |property, value|
30
+ args.last.each do |property, value|
31
31
  result = false unless operation.send(property) == value
32
32
  end
33
33
  result
@@ -80,6 +80,21 @@ describe LegacyMigrations do
80
80
  a.operations.size == 2
81
81
  a.operations[1].type == 'update'
82
82
  end
83
+ it "retrieves a specified operation's results" do
84
+ Person.create(:name => 'aoeu')
85
+ transfer_from Person, :to => Animal do
86
+ from :name, :to => :name
87
+ end
88
+ a = update_from Person, :to => Animal do
89
+ based_on do
90
+ name == from.name
91
+ end
92
+ from :name, :to => :name
93
+ end
94
+ update_op = a.operation_with(:destination => Animal, :type => 'update')
95
+ update_op.should be_instance_of Operation
96
+ update_op.source.should == Person
97
+ end
83
98
 
84
99
  it "records all changes by default" do
85
100
  Person.create(:name => 'aoeu')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legacy_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernie Telles