Permalink
Browse files

FIX: Model missing tag 'address'

  - Added the tag 'address' to the MultiStreetAddress which was missing
    and causing the test to fail

  - Fixed the example which had the same issue
  • Loading branch information...
burtlo committed Jan 19, 2011
1 parent 9e6f8f8 commit 5c88279f79b139469bc3c61cd6301bc69936b2ca
Showing with 16 additions and 14 deletions.
  1. +15 −14 examples/multi_street_address.rb
  2. +1 −0 spec/support/models.rb
@@ -6,24 +6,25 @@
class MultiStreetAddress
include HappyMapper
+ tag 'address'
+
# allow primitive type to be collection
has_many :street_address, String, :tag => "streetaddress"
element :city, String
- element :state_or_providence, String, :tag => "stateOfProvidence"
+ element :state_or_province, String, :tag => "stateOrProvince"
element :zip, String
element :country, String
end
-MultiStreetAddress.parse(file_contents).each do |multi|
-
- puts "Street Address:"
-
- multi.street_address.each do |street|
- puts street
- end
-
- puts "City: #{multi.city}"
- puts "State/Province: #{multi.state_or_province}"
- puts "Zip: #{multi.zip}"
- puts "Country: #{multi.country}"
-end
+multi = MultiStreetAddress.parse(file_contents)
+
+puts "Street Address:"
+
+multi.street_address.each do |street|
+ puts street
+end
+
+puts "City: #{multi.city}"
+puts "State/Province: #{multi.state_or_province}"
+puts "Zip: #{multi.zip}"
+puts "Country: #{multi.country}"
View
@@ -242,6 +242,7 @@ class Address
class MultiStreetAddress
include HappyMapper
+ tag 'address'
# allow primitive type to be collection
has_many :street_address, String, :tag => "streetaddress"
element :city, String

0 comments on commit 5c88279

Please sign in to comment.