Created
July 25, 2017 18:44
-
-
Save staycreativedesign/ae79ef010b9029ebf8f9bf5b23c73d20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BusinessCategory < ApplicationRecord | |
validates_presence_of :name | |
has_many :jobs | |
has_many :business_industries, through: :jobs | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BusinessIndustry < ActiveRecord::Base | |
belongs_to :business_category | |
validates_presence_of :name | |
has_many :jobs | |
has_many :business_categories, through: :jobs | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Job < ApplicationRecord | |
belongs_to :user | |
belongs_to :business_information | |
belongs_to :business_category | |
belongs_to :business_industry | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ApplicationRecord | |
belongs_to :team | |
has_secure_password | |
has_one :membership_payment | |
has_one :membership_application | |
has_one :job | |
accepts_nested_attributes_for :job | |
validates_presence_of :email | |
validates_presence_of :phone_number | |
validates_presence_of :first_name | |
validates_presence_of :last_name | |
validates_presence_of :birthday | |
validates_presence_of :role | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment