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 class MultiStreetAddress
include HappyMapper include HappyMapper


tag 'address'

# allow primitive type to be collection # allow primitive type to be collection
has_many :street_address, String, :tag => "streetaddress" has_many :street_address, String, :tag => "streetaddress"
element :city, String element :city, String
element :state_or_providence, String, :tag => "stateOfProvidence" element :state_or_province, String, :tag => "stateOrProvince"
element :zip, String element :zip, String
element :country, String element :country, String
end end


MultiStreetAddress.parse(file_contents).each do |multi| multi = MultiStreetAddress.parse(file_contents)


puts "Street Address:" puts "Street Address:"


multi.street_address.each do |street| multi.street_address.each do |street|
puts street puts street
end end


puts "City: #{multi.city}" puts "City: #{multi.city}"
puts "State/Province: #{multi.state_or_province}" puts "State/Province: #{multi.state_or_province}"
puts "Zip: #{multi.zip}" puts "Zip: #{multi.zip}"
puts "Country: #{multi.country}" puts "Country: #{multi.country}"
end
1 change: 1 addition & 0 deletions spec/support/models.rb
Expand Up @@ -242,6 +242,7 @@ class Address
class MultiStreetAddress class MultiStreetAddress
include HappyMapper include HappyMapper


tag 'address'
# allow primitive type to be collection # allow primitive type to be collection
has_many :street_address, String, :tag => "streetaddress" has_many :street_address, String, :tag => "streetaddress"
element :city, String element :city, String
Expand Down

0 comments on commit 5c88279

Please sign in to comment.