Commit 115f6c107ef8deee52f10b39e5e7d08c8dd329db
Committed by
Parley
1 parent
f19d2ba5
Exists in
master
and in
5 other branches
more_inst_for_users: Add relation to institution and users.
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing
5 changed files
with
27 additions
and
2 deletions
Show diff stats
db/migrate/20140818195821_remove_institution_from_user.rb
0 → 100644
db/migrate/20140818200738_create_institution_user_relation_table.rb
0 → 100644
lib/ext/user.rb
lib/institution.rb
... | ... | @@ -5,7 +5,7 @@ class Institution < ActiveRecord::Base |
5 | 5 | attr_accessible :name, :acronym, :unit_code, :parent_code, :unit_type, |
6 | 6 | :juridical_nature, :sub_juridical_nature, :normalization_level, |
7 | 7 | :version, :cnpj, :type, :governmental_power, :governmental_sphere |
8 | - has_many :users | |
8 | + has_and_belongs_to_many :users | |
9 | 9 | |
10 | 10 | validates :name, :presence=>true, :uniqueness=>true |
11 | 11 | ... | ... |