Skip to content

Commit

Permalink
Update associations
Browse files Browse the repository at this point in the history
  • Loading branch information
Druotic authored and Shanil Puri committed Sep 22, 2014
1 parent 7391e5b commit 1c6d150
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/models/resume.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Resume < ActiveRecord::Base
belongs_to :jobseekers
belongs_to :users
validates :title, :presence => true, :length => {:maximum => 128}
validates :body, :presence => true, :length => {:maximum => 10000}
validates :owner_id, :presence => true
end
1 change: 1 addition & 0 deletions app/models/skill.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class Skill < ActiveRecord::Base
has_and_belongs_to_many :users
end
5 changes: 2 additions & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
class User < ActiveRecord::Base
has_and_belongs_to_many :roles
has_and_belongs_to_many :roles, :skills, :jobs
has_many :permissions, :through => :roles
has_many :skills
has_and_belongs_to_many :jobs
has_one :resume, :foreign_key => :owner_id

accepts_nested_attributes_for :roles
accepts_nested_attributes_for :skills
Expand Down

0 comments on commit 1c6d150

Please sign in to comment.