property 1.0.0 → 1.1.0
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 +8 -0
- data/Rakefile +1 -1
- data/lib/property/column.rb +19 -5
- data/lib/property/db.rb +13 -4
- data/lib/property/index.rb +19 -10
- data/lib/property/role_module.rb +3 -9
- data/lib/property/serialization/json.rb +13 -9
- data/lib/property/serialization/marshal.rb +17 -10
- data/lib/property/serialization/yaml.rb +15 -7
- data/lib/property/stored_role.rb +1 -1
- data/lib/property/version.rb +3 -0
- data/lib/property.rb +0 -2
- data/property.gemspec +8 -3
- data/test/database.rb +103 -0
- data/test/fixtures.rb +23 -103
- data/test/shoulda_macros/index.rb +12 -23
- data/test/shoulda_macros/role.rb +4 -0
- data/test/shoulda_macros/serialization.rb +17 -1
- data/test/test_helper.rb +4 -0
- data/test/unit/property/attribute_test.rb +5 -5
- data/test/unit/property/column_test.rb +66 -0
- data/test/unit/property/declaration_test.rb +4 -4
- data/test/unit/property/index_complex_test.rb +26 -32
- data/test/unit/property/index_foreign_test.rb +21 -33
- data/test/unit/property/index_simple_test.rb +22 -22
- data/test/unit/property/validation_test.rb +3 -3
- metadata +8 -3
@@ -9,7 +9,7 @@ class ValidationTest < Test::Unit::TestCase
|
|
9
9
|
include Property
|
10
10
|
property.float 'boat'
|
11
11
|
property.string 'bird_name'
|
12
|
-
property.serialize '
|
12
|
+
property.serialize 'cat', Cat
|
13
13
|
end
|
14
14
|
|
15
15
|
subject { Pirate.create }
|
@@ -64,9 +64,9 @@ class ValidationTest < Test::Unit::TestCase
|
|
64
64
|
end
|
65
65
|
|
66
66
|
should 'show an error for serialized types' do
|
67
|
-
subject.update_attributes('
|
67
|
+
subject.update_attributes('cat' => 'Joann Sfar')
|
68
68
|
assert !subject.valid?
|
69
|
-
assert_equal 'cannot cast String to
|
69
|
+
assert_equal 'cannot cast String to Cat', subject.errors['cat']
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 1.0.0
|
9
|
+
version: 1.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Renaud Kern
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-07-22 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -78,7 +78,9 @@ files:
|
|
78
78
|
- lib/property/serialization/yaml.rb
|
79
79
|
- lib/property/stored_column.rb
|
80
80
|
- lib/property/stored_role.rb
|
81
|
+
- lib/property/version.rb
|
81
82
|
- property.gemspec
|
83
|
+
- test/database.rb
|
82
84
|
- test/fixtures.rb
|
83
85
|
- test/shoulda_macros/index.rb
|
84
86
|
- test/shoulda_macros/role.rb
|
@@ -86,6 +88,7 @@ files:
|
|
86
88
|
- test/test_helper.rb
|
87
89
|
- test/unit/property/attribute_test.rb
|
88
90
|
- test/unit/property/base_test.rb
|
91
|
+
- test/unit/property/column_test.rb
|
89
92
|
- test/unit/property/declaration_test.rb
|
90
93
|
- test/unit/property/dirty_test.rb
|
91
94
|
- test/unit/property/index_complex_test.rb
|
@@ -129,6 +132,7 @@ signing_key:
|
|
129
132
|
specification_version: 3
|
130
133
|
summary: model properties wrap into a single database column
|
131
134
|
test_files:
|
135
|
+
- test/database.rb
|
132
136
|
- test/fixtures.rb
|
133
137
|
- test/shoulda_macros/index.rb
|
134
138
|
- test/shoulda_macros/role.rb
|
@@ -136,6 +140,7 @@ test_files:
|
|
136
140
|
- test/test_helper.rb
|
137
141
|
- test/unit/property/attribute_test.rb
|
138
142
|
- test/unit/property/base_test.rb
|
143
|
+
- test/unit/property/column_test.rb
|
139
144
|
- test/unit/property/declaration_test.rb
|
140
145
|
- test/unit/property/dirty_test.rb
|
141
146
|
- test/unit/property/index_complex_test.rb
|