pickle 0.2.10 → 0.2.11
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/History.txt +6 -0
- data/VERSION +1 -1
- data/lib/pickle/session.rb +1 -1
- data/pickle.gemspec +2 -2
- data/spec/pickle/session_spec.rb +4 -3
- metadata +3 -3
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.11
|
data/lib/pickle/session.rb
CHANGED
@@ -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
|
data/pickle.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{pickle}
|
8
|
-
s.version = "0.2.
|
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-
|
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 = [
|
data/spec/pickle/session_spec.rb
CHANGED
@@ -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.
|
413
|
-
|
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
|
-
-
|
9
|
-
version: 0.2.
|
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-
|
17
|
+
date: 2010-05-13 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|