-
-
Save sapient/1336139 to your computer and use it in GitHub Desktop.
This file contains 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 Application < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :job | |
# This model can also have validations to ensure applications are valid, whatever you want. | |
# Extra fields can also be added to this file, so it might get another field :rejected for example. | |
end |
This file contains 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 < ActiveRecord::Base | |
has_many :applications | |
has_many :users, :through => :applications | |
end |
This file contains 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
# encoding: UTF-8 | |
class User < ActiveRecord::Base | |
has_many :applications | |
has_many :jobs, :through => :applications | |
devise :database_authenticatable, :registerable, :recoverable, :trackable, :validatable | |
attr_accessible :email, :password, | |
:password_confirmation, | |
:remember_me, | |
:fname, | |
:lname, | |
:bday, | |
:address, | |
:areacode, | |
:city, | |
:education, | |
:info, | |
:looking_for, | |
:tele, | |
:cv, | |
:cv_file_name, | |
:cv_content_type, | |
:cv_file_size, | |
:cv_updated_at | |
has_attached_file :cv | |
validates_attachment_size :cv, :less_than => 2.megabytes | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment