pickle 0.2.10 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ == 0.2.11
2
+
3
+ * 1 improvement
4
+ * use correct type when converting STI pickle model to attributes
5
+
6
+
1
7
  == 0.2.10
2
8
 
3
9
  * 2 improvements
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.10
1
+ 0.2.11
@@ -145,7 +145,7 @@ module Pickle
145
145
  attrs.each do |key, val|
146
146
  if val.is_a?(ActiveRecord::Base) && ar_class.column_names.include?("#{key}_id")
147
147
  attrs["#{key}_id"] = val.id
148
- attrs["#{key}_type"] = val.class.name if ar_class.column_names.include?("#{key}_type")
148
+ attrs["#{key}_type"] = val.class.base_class.name if ar_class.column_names.include?("#{key}_type")
149
149
  attrs.delete(key)
150
150
  end
151
151
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pickle}
8
- s.version = "0.2.10"
8
+ s.version = "0.2.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ian White"]
12
- s.date = %q{2010-04-27}
12
+ s.date = %q{2010-05-13}
13
13
  s.description = %q{Easy model creation and reference in your cucumber features}
14
14
  s.email = %q{ian.w.white@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -408,9 +408,10 @@ describe Pickle::Session do
408
408
  let :ar_class do
409
409
  mock('ActiveRecord', :column_names => ['user_id', 'user_type'])
410
410
  end
411
-
412
- it "should return {'user_id' => <the user.id>, 'user_type' => <the user.type>}" do
413
- convert_models_to_attributes(ar_class, :user => user).should == {'user_id' => user.id, 'user_type' => user.class.name}
411
+
412
+ it "should return {'user_id' => <the user.id>, 'user_type' => <the user.base_class>}" do
413
+ user.class.should_receive(:base_class).and_return(mock('User base class', :name => 'UserBase'))
414
+ convert_models_to_attributes(ar_class, :user => user).should == {'user_id' => user.id, 'user_type' => 'UserBase'}
414
415
  end
415
416
  end
416
417
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 10
9
- version: 0.2.10
8
+ - 11
9
+ version: 0.2.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ian White
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-27 00:00:00 +01:00
17
+ date: 2010-05-13 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies: []
20
20