Skip to content

Commit

Permalink
FIX: Model missing tag 'address'
Browse files Browse the repository at this point in the history
  - 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
Franklin Webber committed Jan 19, 2011
1 parent 9e6f8f8 commit 5c88279
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
29 changes: 15 additions & 14 deletions examples/multi_street_address.rb
Expand Up @@ -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}"
1 change: 1 addition & 0 deletions spec/support/models.rb
Expand Up @@ -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
Expand Down

0 comments on commit 5c88279

Please sign in to comment.