fix style code

parent 6f1d6333
Pipeline #1404 failed with stages
in 0 seconds
...@@ -26,6 +26,6 @@ class Users::ConfirmationsController < Devise::ConfirmationsController ...@@ -26,6 +26,6 @@ class Users::ConfirmationsController < Devise::ConfirmationsController
# The path used after confirmation. # The path used after confirmation.
def after_confirmation_path_for(resource_name, resource) def after_confirmation_path_for(resource_name, resource)
sign_in(resource) sign_in(resource)
root_path my_path
end end
end end
...@@ -3,7 +3,7 @@ class ApplyJob < ApplicationRecord ...@@ -3,7 +3,7 @@ class ApplyJob < ApplicationRecord
belongs_to :job belongs_to :job
has_one_attached :cv has_one_attached :cv
validates :name, presence: true, length: { maximum: 200 } validates :name, presence: true, length: { maximum: 200 }
VALID_FILE_UPLOAD = %w[application/msword application/pdf application/xls application/xlsx application/zip] VALID_FILE_UPLOAD = %w[application/msword application/pdf application/xls application/xlsx application/zip].freeze
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX } validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX }
validates :cv, presence: true, content_type: { in: VALID_FILE_UPLOAD, message: 'must be a valid pdf format' }, validates :cv, presence: true, content_type: { in: VALID_FILE_UPLOAD, message: 'must be a valid pdf format' },
......
...@@ -3,12 +3,12 @@ class User < ApplicationRecord ...@@ -3,12 +3,12 @@ class User < ApplicationRecord
has_many :apply_jobs, dependent: :destroy has_many :apply_jobs, dependent: :destroy
has_many :favorite_jobs, dependent: :destroy has_many :favorite_jobs, dependent: :destroy
has_many :history_jobs, dependent: :destroy has_many :history_jobs, dependent: :destroy
VALID_FILE_UPLOAD = %w[application/msword application/pdf application/xls application/xlsx application/zip] VALID_FILE_UPLOAD = %w[application/msword application/pdf application/xls application/xlsx application/zip].freeze
devise :database_authenticatable, :registerable, devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :recoverable, :rememberable, :trackable, :validatable,
:confirmable :confirmable
validates :name, length: { maximum: 200 } validates :name, length: { maximum: 200 }
validates :email, length: { maximum: 200 }, uniqueness: true validates :email, length: { maximum: 200 }, uniqueness: true
validates :cv, content_type: { in: VALID_FILE_UPLOAD, message: 'must be msword, pdf, xls, xlsx, zip format'}, validates :cv, content_type: { in: VALID_FILE_UPLOAD, message: 'must be msword, pdf, xls, xlsx, zip format' },
size: { less_than: 5.megabytes, message: 'should be less than 5MB' } size: { less_than: 5.megabytes, message: 'should be less than 5MB' }
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment