From c62cc4ce28c05c82ba9bd659f8eee027e463435b Mon Sep 17 00:00:00 2001 From: James Beavers Date: Sat, 20 Sep 2014 15:23:22 -0400 Subject: [PATCH] Added basic models and associations discussed previously --- app/models/category.rb | 3 +++ app/models/job.rb | 4 ++++ app/models/jobseeker.rb | 3 +++ app/models/skill.rb | 2 ++ app/models/tag.rb | 3 +++ 5 files changed, 15 insertions(+) create mode 100644 app/models/category.rb create mode 100644 app/models/job.rb create mode 100644 app/models/jobseeker.rb create mode 100644 app/models/skill.rb create mode 100644 app/models/tag.rb diff --git a/app/models/category.rb b/app/models/category.rb new file mode 100644 index 0000000..3437f68 --- /dev/null +++ b/app/models/category.rb @@ -0,0 +1,3 @@ +class Category < ActiveRecord::Base + has_many :jobs +end \ No newline at end of file diff --git a/app/models/job.rb b/app/models/job.rb new file mode 100644 index 0000000..0ecd8e7 --- /dev/null +++ b/app/models/job.rb @@ -0,0 +1,4 @@ +class Job < ActiveRecord::Base + has_and_belongs_to_many :tags + has_one :category +end \ No newline at end of file diff --git a/app/models/jobseeker.rb b/app/models/jobseeker.rb new file mode 100644 index 0000000..fe4d723 --- /dev/null +++ b/app/models/jobseeker.rb @@ -0,0 +1,3 @@ +class Jobseeker < ActiveRecord::Base + has_and_belongs_to_many :roles +end \ No newline at end of file diff --git a/app/models/skill.rb b/app/models/skill.rb new file mode 100644 index 0000000..f60b98a --- /dev/null +++ b/app/models/skill.rb @@ -0,0 +1,2 @@ +class Skill < ActiveRecord::Base +end \ No newline at end of file diff --git a/app/models/tag.rb b/app/models/tag.rb new file mode 100644 index 0000000..999778c --- /dev/null +++ b/app/models/tag.rb @@ -0,0 +1,3 @@ +class Tag < ActiveRecord::Base + has_and_belongs_to_many :jobs +end \ No newline at end of file