diff --git a/lib/ext/person.rb b/lib/ext/person.rb index 9f48a40..dfba1f0 100644 --- a/lib/ext/person.rb +++ b/lib/ext/person.rb @@ -6,4 +6,17 @@ class Person attr_accessible :orientacao_sexual, :identidade_genero, :transgenero, :tipo, :etnia + def city= city + city = City.find(city) unless city.kind_of?(City) + self.region = city + end + + def city + self.region + end + + def state + self.region.parent if self.region + end + end -- libgit2 0.21.2