hr_engine6 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +32 -0
  5. data/app/assets/config/hr_engine6_manifest.js +1 -0
  6. data/app/assets/stylesheets/hr_engine6/admins.css +4 -0
  7. data/app/assets/stylesheets/hr_engine6/application.css +15 -0
  8. data/app/assets/stylesheets/hr_engine6/clients.css +4 -0
  9. data/app/assets/stylesheets/hr_engine6/job_applicants.css +4 -0
  10. data/app/assets/stylesheets/hr_engine6/job_applications.css +4 -0
  11. data/app/assets/stylesheets/hr_engine6/job_listings.css +4 -0
  12. data/app/assets/stylesheets/scaffold.css +80 -0
  13. data/app/controllers/hr_engine6/admins_controller.rb +79 -0
  14. data/app/controllers/hr_engine6/application_controller.rb +5 -0
  15. data/app/controllers/hr_engine6/clients_controller.rb +79 -0
  16. data/app/controllers/hr_engine6/job_applicants_controller.rb +129 -0
  17. data/app/controllers/hr_engine6/job_applications_controller.rb +81 -0
  18. data/app/controllers/hr_engine6/job_listings_controller.rb +86 -0
  19. data/app/helpers/hr_engine6/admins_helper.rb +4 -0
  20. data/app/helpers/hr_engine6/application_helper.rb +4 -0
  21. data/app/helpers/hr_engine6/clients_helper.rb +4 -0
  22. data/app/helpers/hr_engine6/job_applicants_helper.rb +4 -0
  23. data/app/helpers/hr_engine6/job_applications_helper.rb +4 -0
  24. data/app/helpers/hr_engine6/job_listings_helper.rb +4 -0
  25. data/app/jobs/hr_engine6/application_job.rb +4 -0
  26. data/app/mailers/hr_engine6/application_mailer.rb +6 -0
  27. data/app/models/hr_engine6/admin.rb +4 -0
  28. data/app/models/hr_engine6/application_record.rb +5 -0
  29. data/app/models/hr_engine6/client.rb +4 -0
  30. data/app/models/hr_engine6/job_applicant.rb +6 -0
  31. data/app/models/hr_engine6/job_application.rb +6 -0
  32. data/app/models/hr_engine6/job_listing.rb +6 -0
  33. data/app/views/hr_engine6/admins/_admin.json.jbuilder +2 -0
  34. data/app/views/hr_engine6/admins/_form.html.erb +17 -0
  35. data/app/views/hr_engine6/admins/edit.html.erb +6 -0
  36. data/app/views/hr_engine6/admins/index.html.erb +25 -0
  37. data/app/views/hr_engine6/admins/index.json.jbuilder +1 -0
  38. data/app/views/hr_engine6/admins/new.html.erb +5 -0
  39. data/app/views/hr_engine6/admins/show.html.erb +4 -0
  40. data/app/views/hr_engine6/admins/show.json.jbuilder +1 -0
  41. data/app/views/hr_engine6/clients/_client.json.jbuilder +2 -0
  42. data/app/views/hr_engine6/clients/_form.html.erb +17 -0
  43. data/app/views/hr_engine6/clients/edit.html.erb +6 -0
  44. data/app/views/hr_engine6/clients/index.html.erb +25 -0
  45. data/app/views/hr_engine6/clients/index.json.jbuilder +1 -0
  46. data/app/views/hr_engine6/clients/new.html.erb +5 -0
  47. data/app/views/hr_engine6/clients/show.html.erb +4 -0
  48. data/app/views/hr_engine6/clients/show.json.jbuilder +1 -0
  49. data/app/views/hr_engine6/job_applicants/_form.html.erb +96 -0
  50. data/app/views/hr_engine6/job_applicants/_job_applicant.json.jbuilder +2 -0
  51. data/app/views/hr_engine6/job_applicants/edit.html.erb +6 -0
  52. data/app/views/hr_engine6/job_applicants/index.html.erb +49 -0
  53. data/app/views/hr_engine6/job_applicants/index.json.jbuilder +1 -0
  54. data/app/views/hr_engine6/job_applicants/new.html.erb +5 -0
  55. data/app/views/hr_engine6/job_applicants/show.html.erb +72 -0
  56. data/app/views/hr_engine6/job_applicants/show.json.jbuilder +1 -0
  57. data/app/views/hr_engine6/job_applications/_form.html.erb +20 -0
  58. data/app/views/hr_engine6/job_applications/_job_application.json.jbuilder +2 -0
  59. data/app/views/hr_engine6/job_applications/edit.html.erb +6 -0
  60. data/app/views/hr_engine6/job_applications/index.html.erb +36 -0
  61. data/app/views/hr_engine6/job_applications/index.json.jbuilder +1 -0
  62. data/app/views/hr_engine6/job_applications/new.html.erb +6 -0
  63. data/app/views/hr_engine6/job_applications/show.html.erb +35 -0
  64. data/app/views/hr_engine6/job_applications/show.json.jbuilder +1 -0
  65. data/app/views/hr_engine6/job_listings/_form.html.erb +32 -0
  66. data/app/views/hr_engine6/job_listings/_job_listing.json.jbuilder +2 -0
  67. data/app/views/hr_engine6/job_listings/clientindex.html.erb +32 -0
  68. data/app/views/hr_engine6/job_listings/clientindex.json.jbuilder +1 -0
  69. data/app/views/hr_engine6/job_listings/clientshow.html.erb +18 -0
  70. data/app/views/hr_engine6/job_listings/clientshow.json.jbuilder +1 -0
  71. data/app/views/hr_engine6/job_listings/edit.html.erb +6 -0
  72. data/app/views/hr_engine6/job_listings/index.html.erb +32 -0
  73. data/app/views/hr_engine6/job_listings/index.json.jbuilder +1 -0
  74. data/app/views/hr_engine6/job_listings/new.html.erb +5 -0
  75. data/app/views/hr_engine6/job_listings/show.html.erb +19 -0
  76. data/app/views/hr_engine6/job_listings/show.json.jbuilder +1 -0
  77. data/app/views/layouts/hr_engine6/application.html.erb +15 -0
  78. data/config/routes.rb +16 -0
  79. data/db/migrate/20200818121456_create_hr_engine6_job_applicants.rb +21 -0
  80. data/db/migrate/20200818121603_create_hr_engine6_job_applications.rb +8 -0
  81. data/db/migrate/20200818121658_create_hr_engine6_job_listings.rb +11 -0
  82. data/db/migrate/20200818121718_create_hr_engine6_admins.rb +8 -0
  83. data/db/migrate/20200818121745_create_hr_engine6_clients.rb +8 -0
  84. data/db/migrate/20200818122121_job_applicant_belongs_to_admin.rb +7 -0
  85. data/db/migrate/20200818122511_job_listings_belong_to_admin.rb +7 -0
  86. data/db/migrate/20200818122602_job_application_belongs_to_admin.rb +7 -0
  87. data/db/migrate/20200818122713_job_applicant_belongs_to_client.rb +7 -0
  88. data/db/migrate/20200818122753_job_application_belongs_to_client.rb +7 -0
  89. data/db/migrate/20200818122831_job_listing_belongs_to_client.rb +7 -0
  90. data/db/migrate/20200818123256_job_application_belongs_to_all2.rb +13 -0
  91. data/db/migrate/20200820135913_job_application_has_all2.rb +15 -0
  92. data/db/migrate/20200820145522_job_applicant_belongs_to_listings.rb +9 -0
  93. data/lib/hr_engine6.rb +5 -0
  94. data/lib/hr_engine6/engine.rb +5 -0
  95. data/lib/hr_engine6/version.rb +3 -0
  96. data/lib/tasks/hr_engine6_tasks.rake +4 -0
  97. metadata +172 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c7f64d0941db1c0826cb0a48313d82c36de8f3e4ef62c5a7ed5def9fd8e01c64
4
+ data.tar.gz: 7c953ec8b51853fe9b468a195efe81f0f391a6f62042918510e595774bce1130
5
+ SHA512:
6
+ metadata.gz: bd398e7c6024268fe0bb5057639631136b005e2eaee2db3ef30b02e9053dbdf3ff26ada1b1ca5f08f72c97a5e52ecb45805e250cf399f50fbd090b5a2e2894c6
7
+ data.tar.gz: 3db5ee879f27b68c2f0c521d49cfddd1eb439a2247b142f3a6722df5bdbb7b47767293c569d23c11cfb9634feba9e04b2be28c83374fcbb753a7f8b954fa46dc
@@ -0,0 +1,20 @@
1
+ Copyright 2020 Emre Boyaci
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,28 @@
1
+ # HrEngine6
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'hr_engine6'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install hr_engine6
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'HrEngine6'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+ load 'rails/tasks/statistics.rake'
21
+
22
+ require 'bundler/gem_tasks'
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'test'
28
+ t.pattern = 'test/**/*_test.rb'
29
+ t.verbose = false
30
+ end
31
+
32
+ task default: :test
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/hr_engine6 .css
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,80 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ margin: 33px;
5
+ }
6
+
7
+ body, p, ol, ul, td {
8
+ font-family: verdana, arial, helvetica, sans-serif;
9
+ font-size: 13px;
10
+ line-height: 18px;
11
+ }
12
+
13
+ pre {
14
+ background-color: #eee;
15
+ padding: 10px;
16
+ font-size: 11px;
17
+ }
18
+
19
+ a {
20
+ color: #000;
21
+ }
22
+
23
+ a:visited {
24
+ color: #666;
25
+ }
26
+
27
+ a:hover {
28
+ color: #fff;
29
+ background-color: #000;
30
+ }
31
+
32
+ th {
33
+ padding-bottom: 5px;
34
+ }
35
+
36
+ td {
37
+ padding: 0 5px 7px;
38
+ }
39
+
40
+ div.field,
41
+ div.actions {
42
+ margin-bottom: 10px;
43
+ }
44
+
45
+ #notice {
46
+ color: green;
47
+ }
48
+
49
+ .field_with_errors {
50
+ padding: 2px;
51
+ background-color: red;
52
+ display: table;
53
+ }
54
+
55
+ #error_explanation {
56
+ width: 450px;
57
+ border: 2px solid red;
58
+ padding: 7px 7px 0;
59
+ margin-bottom: 20px;
60
+ background-color: #f0f0f0;
61
+ }
62
+
63
+ #error_explanation h2 {
64
+ text-align: left;
65
+ font-weight: bold;
66
+ padding: 5px 5px 5px 15px;
67
+ font-size: 12px;
68
+ margin: -7px -7px 0;
69
+ background-color: #c00;
70
+ color: #fff;
71
+ }
72
+
73
+ #error_explanation ul li {
74
+ font-size: 12px;
75
+ list-style: square;
76
+ }
77
+
78
+ label {
79
+ display: block;
80
+ }
@@ -0,0 +1,79 @@
1
+ require_dependency "hr_engine6/application_controller"
2
+
3
+ module HrEngine6
4
+ class AdminsController < ApplicationController
5
+ before_action :set_admin, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /admins
8
+ # GET /admins.json
9
+ def index
10
+ @admins = Admin.all
11
+ end
12
+
13
+ # GET /admins/1
14
+ # GET /admins/1.json
15
+ def show
16
+ end
17
+
18
+ # GET /admins/new
19
+ def new
20
+ @admin = Admin.new
21
+ end
22
+
23
+ # GET /admins/1/edit
24
+ def edit
25
+ end
26
+
27
+ # POST /admins
28
+ # POST /admins.json
29
+ def create
30
+ @admin = Admin.new(admin_params)
31
+
32
+ respond_to do |format|
33
+ if @admin.save
34
+ format.html { redirect_to @admin, notice: 'Admin başarıyla oluşturuldu.' }
35
+ format.json { render :show, status: :created, location: @admin }
36
+ else
37
+ format.html { render :new }
38
+ format.json { render json: @admin.errors, status: :unprocessable_entity }
39
+ end
40
+ end
41
+ end
42
+
43
+ # PATCH/PUT /admins/1
44
+ # PATCH/PUT /admins/1.json
45
+ def update
46
+ respond_to do |format|
47
+ if @admin.update(admin_params)
48
+ format.html { redirect_to @admin, notice: 'Admin başarıyla güncellendi.' }
49
+ format.json { render :show, status: :ok, location: @admin }
50
+ else
51
+ format.html { render :edit }
52
+ format.json { render json: @admin.errors, status: :unprocessable_entity }
53
+ end
54
+ end
55
+ end
56
+
57
+ # DELETE /admins/1
58
+ # DELETE /admins/1.json
59
+ def destroy
60
+ @admin.destroy
61
+ respond_to do |format|
62
+ format.html { redirect_to admins_url, notice: 'Admin başarıyla silindi.' }
63
+ format.json { head :no_content }
64
+ end
65
+ end
66
+
67
+ private
68
+ # Use callbacks to share common setup or constraints between actions.
69
+ def set_admin
70
+ @admin = Admin.find(params[:id])
71
+ end
72
+
73
+ # Only allow a list of trusted parameters through.
74
+ def admin_params
75
+ params.fetch(:admin, {})
76
+ end
77
+ end
78
+
79
+ end
@@ -0,0 +1,5 @@
1
+ module HrEngine6
2
+ class ApplicationController < ActionController::Base
3
+ protect_from_forgery with: :exception
4
+ end
5
+ end
@@ -0,0 +1,79 @@
1
+ require_dependency "hr_engine6/application_controller"
2
+
3
+ module HrEngine6
4
+ class ClientsController < ApplicationController
5
+ before_action :set_client, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /clients
8
+ # GET /clients.json
9
+ def index
10
+ @clients = Client.all
11
+ end
12
+
13
+ # GET /clients/1
14
+ # GET /clients/1.json
15
+ def show
16
+ end
17
+
18
+ # GET /clients/new
19
+ def new
20
+ @client = Client.new
21
+ end
22
+
23
+ # GET /clients/1/edit
24
+ def edit
25
+ end
26
+
27
+ # POST /clients
28
+ # POST /clients.json
29
+ def create
30
+ @client = Client.new(client_params)
31
+
32
+ respond_to do |format|
33
+ if @client.save
34
+ format.html { redirect_to @client, notice: 'Client was successfully created.' }
35
+ format.json { render :show, status: :created, location: @client }
36
+ else
37
+ format.html { render :new }
38
+ format.json { render json: @client.errors, status: :unprocessable_entity }
39
+ end
40
+ end
41
+ end
42
+
43
+ # PATCH/PUT /clients/1
44
+ # PATCH/PUT /clients/1.json
45
+ def update
46
+ respond_to do |format|
47
+ if @client.update(client_params)
48
+ format.html { redirect_to @client, notice: 'Client was successfully updated.' }
49
+ format.json { render :show, status: :ok, location: @client }
50
+ else
51
+ format.html { render :edit }
52
+ format.json { render json: @client.errors, status: :unprocessable_entity }
53
+ end
54
+ end
55
+ end
56
+
57
+ # DELETE /clients/1
58
+ # DELETE /clients/1.json
59
+ def destroy
60
+ @client.destroy
61
+ respond_to do |format|
62
+ format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }
63
+ format.json { head :no_content }
64
+ end
65
+ end
66
+
67
+ private
68
+ # Use callbacks to share common setup or constraints between actions.
69
+ def set_client
70
+ @client = Client.find(params[:id])
71
+ end
72
+
73
+ # Only allow a list of trusted parameters through.
74
+ def client_params
75
+ params.fetch(:client, {})
76
+ end
77
+ end
78
+
79
+ end
@@ -0,0 +1,129 @@
1
+ require_dependency 'hr_engine6/application_controller'
2
+ require 'aws-sdk'
3
+
4
+ module HrEngine6
5
+ class JobApplicantsController < ApplicationController
6
+ before_action :set_job_applicant, only: [:show, :edit, :update, :destroy]
7
+
8
+ # GET /job_applicants
9
+ # GET /job_applicants.json
10
+ def index
11
+ @job_applicants = JobApplicant.all
12
+ end
13
+
14
+ # GET /job_applicants/1
15
+ # GET /job_applicants/1.json
16
+ def show
17
+ end
18
+
19
+ # GET /job_applicants/new
20
+ def new
21
+ @job_applicant = JobApplicant.new
22
+ end
23
+
24
+ # GET /job_applicants/1/edit
25
+ def edit
26
+ end
27
+
28
+ # POST /job_applicants
29
+ # POST /job_applicants.json
30
+ def create
31
+ @job_applicant = JobApplicant.new(job_applicant_params)
32
+
33
+ respond_to do |format|
34
+ if @job_applicant.save
35
+ s3 = Aws::S3::Resource.new
36
+
37
+ #dosyanın kabul edilen fotoğraf formatlarından biriyle bitmesi önemli
38
+ if(params['job_applicant'][:image].present?) #image seçilmişse yükle
39
+ if params['job_applicant'][:image].original_filename.include?('png')
40
+ upload_file('png', s3)
41
+ elsif params['job_applicant'][:image].original_filename.include?('jpeg')
42
+ upload_file('jpeg', s3)
43
+ elsif params['job_applicant'][:image].original_filename.include?('jpg')
44
+ upload_file('jpeg', s3)
45
+ end
46
+ end
47
+
48
+ #dosyanın kabul edilen döküman formatlarından biriyle bitmesi önemli
49
+ if(params['job_applicant'][:cv].present?) #cv seçilmişse yükle
50
+ if params['job_applicant'][:cv].original_filename.include?('doc')
51
+ upload_file('doc', s3)
52
+ elsif params['job_applicant'][:cv].original_filename.include?('docx')
53
+ upload_file('docx', s3)
54
+ elsif params['job_applicant'][:cv].original_filename.include?('pdf')
55
+ upload_file('pdf', s3)
56
+ end
57
+ end
58
+
59
+
60
+ format.html { redirect_to @job_applicant, notice: 'Aday profili başarıyla oluşturuldu.' }
61
+ format.json { render :show, status: :created, location: @job_applicant }
62
+ else
63
+ format.html { render :new }
64
+ format.json { render json: @job_applicant.errors, status: :unprocessable_entity }
65
+ end
66
+ end
67
+ end
68
+
69
+ # PATCH/PUT /job_applicants/1
70
+ # PATCH/PUT /job_applicants/1.json
71
+ def update
72
+ respond_to do |format|
73
+ if @job_applicant.update(job_applicant_params)
74
+ format.html { redirect_to @job_applicant, notice: 'Aday profili başarıyla güncellendi.' }
75
+ format.json { render :show, status: :ok, location: @job_applicant }
76
+ else
77
+ format.html { render :edit }
78
+ format.json { render json: @job_applicant.errors, status: :unprocessable_entity }
79
+ end
80
+ end
81
+ end
82
+
83
+ # DELETE /job_applicants/1
84
+ # DELETE /job_applicants/1.json
85
+ def destroy
86
+ @job_applicant.destroy
87
+ respond_to do |format|
88
+ format.html { redirect_to job_applicants_url, notice: 'Aday profili başarıyla silindi.' }
89
+ format.json { head :no_content }
90
+ end
91
+ end
92
+
93
+ private
94
+
95
+ # Use callbacks to share common setup or constraints between actions.
96
+ def set_job_applicant
97
+ @job_applicant = JobApplicant.find(params[:id])
98
+ end
99
+
100
+ # Only allow a list of trusted parameters through.
101
+ def job_applicant_params
102
+ params.require(:job_applicant).permit(:name, :surname, :birth_date, :birth_place, :address, :e_mail,
103
+ :mobile_phone, :house_phone, :nationality, :graduated_school, :position,
104
+ :foreign_language, :hr_engine6_job_listing_id)
105
+ end
106
+
107
+ #dosyayı aws'ye yükleyen metod
108
+ def upload_file(ext, s3)
109
+
110
+ #dosyayı oluştur ve içine veriyi yaz
111
+ open("/tmp/file#{@job_applicant.id}.#{ext}", 'w+') do |file|
112
+ if ext == 'png' || ext == 'jpeg' || ext == 'jpg'
113
+ file << File.open(params['job_applicant'][:image].tempfile).read
114
+ elsif ext == 'doc' || ext == 'docx' || ext == 'pdf'
115
+ file << File.open(params['job_applicant'][:cv].tempfile).read
116
+ end
117
+
118
+ name = File.basename(file) #extension'ıyla birlikte döndürüyor
119
+ object = s3.bucket('futurino').object("hr/#{name}")
120
+ #Parametre olarak File objesini değil de path'ini vermemiz önemli, aksi takdirde çok yavaş çalışıyor
121
+ object.upload_file(file.path)
122
+
123
+ #bitince dosyayı local makineden silebiliriz, ihtiyacımız kalmadı
124
+ FileUtils.rm_rf(file.path)
125
+ end
126
+ end
127
+
128
+ end
129
+ end