Commit 8fb44a478abb5ccd345b8ffaf1f37817d273ad30

Authored by Caio Almeida
1 parent 395255b6
Exists in master

adding aditional fields

lib/ext/article.rb
... ... @@ -5,4 +5,8 @@ class Article
5 5 has_many :states, :through => :article_categorizations, :source => :category, :class_name => State
6 6 has_many :cities, :through => :article_categorizations, :source => :category, :class_name => City
7 7  
  8 + settings_items :free_conference
  9 +
  10 + attr_accessible :free_conference
  11 +
8 12 end
... ...
lib/ext/environment.rb
... ... @@ -8,6 +8,7 @@ class Environment
8 8 orig_custom_person_fields.merge!({'orientacao_sexual' => {"active"=>"true", "required"=>"false", "signup"=>"true"}})
9 9 orig_custom_person_fields.merge!({'identidade_genero' => {"active"=>"true", "required"=>"false", "signup"=>"true"}})
10 10 orig_custom_person_fields.merge!({'transgenero' => {"active"=>"true", "required"=>"false", "signup"=>"true"}})
  11 + orig_custom_person_fields.merge!({'etnia' => {"active"=>"true", "required"=>"false", "signup"=>"true"}})
11 12 end
12 13  
13 14 end
... ...
lib/ext/person.rb
... ... @@ -2,8 +2,8 @@ require_dependency 'person'
2 2  
3 3 class Person
4 4  
5   - settings_items :orientacao_sexual, :identidade_genero, :transgenero, :tipo
  5 + settings_items :orientacao_sexual, :identidade_genero, :transgenero, :tipo, :etnia
6 6  
7   - attr_accessible :orientacao_sexual, :identidade_genero, :transgenero, :tipo
  7 + attr_accessible :orientacao_sexual, :identidade_genero, :transgenero, :tipo, :etnia
8 8  
9 9 end
... ...
lib/ext/user.rb
... ... @@ -34,6 +34,19 @@ class User
34 34 self.person_data[:tipo] = value
35 35 end
36 36  
  37 + def etnia
  38 + self.person.etnia unless self.person.nil?
  39 + end
  40 +
  41 + def etnia= value
  42 + self.person_data[:etnia] = value
  43 + end
  44 +
  45 + def city= city
  46 + city = City.find(city) unless city.kind_of?(City)
  47 + self.person_data[:region] = city
  48 + end
  49 +
37 50 def category_ids= categories
38 51 self.person_data[:category_ids] = categories
39 52 end
... ...