class Address < ActiveRestClient::Base
def full_string
return "#{self.street}, #{self.city}, #{self.region}, #{self.country}"
end
end
class Person < ActiveRestClient::Base
get :find, "/people/:id", :has_one => {:address => Address}
end
It will instantiate the address class instead of the Person class and you can then call things like
puts @person.address.full_string
If there is anything I can do to help get this merged I'd love to work with you guys on doing that, thanks!
Coverage decreased (-0.18%) to 98.99% when pulling 544a384f1a25296b4041dc9c21f893e271fa1898 on nathanhoel:has-one-association into ea0a7af1ec848e21a92e126f53a2071e1427a5b0 on whichdigital:master.
Coverage decreased (-0.18%) to 98.99% when pulling 544a384f1a25296b4041dc9c21f893e271fa1898 on nathanhoel:has-one-association into ea0a7af1ec848e21a92e126f53a2071e1427a5b0 on whichdigital:master.
Coverage increased (+0.01%) to 99.18% when pulling fc56ec40e52633d17dc7383c537fb18789e6d50f on nathanhoel:has-one-association into ea0a7af1ec848e21a92e126f53a2071e1427a5b0 on whichdigital:master.
Coverage increased (+0.01%) to 99.18% when pulling fc56ec40e52633d17dc7383c537fb18789e6d50f on nathanhoel:has-one-association into ea0a7af1ec848e21a92e126f53a2071e1427a5b0 on whichdigital:master.
Allows you to recursively support single association relationship types.
If you have JSON like
and classes like this
It will instantiate the address class instead of the Person class and you can then call things like
puts @person.address.full_string
If there is anything I can do to help get this merged I'd love to work with you guys on doing that, thanks!