Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit effa9a0

Browse files
committedMay 22, 2018
Fixes
1 parent 53017b5 commit effa9a0

File tree

3 files changed

+9
-85
lines changed

3 files changed

+9
-85
lines changed
 

‎app/controllers/web/jobs_controller.rb

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def create
1818
@job = CreateJob.call(current_user, job_params)
1919

2020
if @job.save
21+
@job.approve!
2122
redirect_to job_path(@job), notice: t('common.jobs.create.success')
2223
else
2324
render :new, alert: t('common.jobs.create.fail')

‎db/fixtures/_users.rb

Whitespace-only changes.

‎db/seeds.rb

+8-85
Original file line numberDiff line numberDiff line change
@@ -2,91 +2,14 @@
22

33
User.destroy_all
44

5-
User.seed do |s|
6-
s.id = 1
7-
s.password = 'password'
8-
s.password_confirmation = 'password'
9-
s.salt = 'asdasdastr4325234324sdfds'
10-
s.crypted_password = Sorcery::CryptoProviders::BCrypt.encrypt('password', 'asdasdastr4325234324sdfds')
11-
s.email = Faker::Internet.email
12-
s.roles = ['junior']
13-
end
5+
User.create({
6+
password: 'password',
7+
password_confirmation: 'password',
8+
salt: 'asdasdastr4325234324sdfds',
9+
crypted_password: Sorcery::CryptoProviders::BCrypt.encrypt('password', 'asdasdastr4325234324sdfds'),
10+
email: 'admin@example.com',
11+
roles: ['admin']
12+
})
1413

15-
User.seed do |s|
16-
s.id = 2
17-
s.password = 'password'
18-
s.password_confirmation = 'password'
19-
s.salt = 'asdasdastr4325234324sdfds'
20-
s.crypted_password = Sorcery::CryptoProviders::BCrypt.encrypt('password', 'asdasdastr4325234324sdfds')
21-
s.email = Faker::Internet.email
22-
s.roles = ['company']
23-
end
2414

25-
User.seed do |s|
26-
s.id = 3
27-
s.password = 'password'
28-
s.password_confirmation = 'password'
29-
s.salt = 'asdasdastr4325234324sdfds'
30-
s.crypted_password = Sorcery::CryptoProviders::BCrypt.encrypt('password', 'asdasdastr4325234324sdfds')
31-
s.email = 'admin@example.com'
32-
s.roles = ['admin']
33-
end
3415

35-
Job.destroy_all
36-
37-
10.times do |i|
38-
Job.seed do |s|
39-
s.id = i
40-
s.title = Faker::Job.title
41-
s.description = Faker::Lorem.sentence
42-
s.token = "token#{i}"
43-
s.employment = %w[full part contract internal].sample
44-
s.currency = Settings.currencies.sample
45-
s.expired_at = Date.current + 1.week
46-
s.specialization = Faker::ProgrammingLanguage.name
47-
s.language = %w[English Russian].sample
48-
s.company_phone = Faker::PhoneNumber.cell_phone
49-
s.company_page = Faker::Internet.url
50-
s.company_contact = Faker::Name.name
51-
s.company_email = Faker::Internet.email
52-
s.company_name = Faker::Company.name
53-
s.requirements = Faker::Job.key_skill
54-
s.salary_from = [*1..3].sample*10000
55-
s.salary_to = [*3..20].sample*10000
56-
s.salary_by_agreement = [*0..1].sample
57-
s.remote = [*0..1].sample
58-
s.city = Faker::Address.city
59-
s.country = Faker::Address.country
60-
s.status = %w[approved not_approved].sample
61-
end
62-
end
63-
64-
Subscription.destroy_all
65-
66-
Subscription.seed do |s|
67-
s.id = 1
68-
s.active = true
69-
s.user_id = 1
70-
s.email = User.find(1).email
71-
end
72-
73-
Subscription.seed do |s|
74-
s.id = 2
75-
s.active = false
76-
s.user_id = 2
77-
s.email = User.find(2).email
78-
end
79-
80-
Subscription.seed do |s|
81-
s.id = 3
82-
s.active = true
83-
s.user_id = nil
84-
s.email = Faker::Internet.email
85-
end
86-
87-
Subscription.seed do |s|
88-
s.id = 4
89-
s.active = false
90-
s.user_id = nil
91-
s.email = Faker::Internet.email
92-
end

0 commit comments

Comments
 (0)
Please sign in to comment.