diff --git a/.gitignore b/.gitignore index d3d7cab..9109974 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,7 @@ doc/ /public/system # Ignore sample images -/sampleimages \ No newline at end of file +/sampleimages + +# Ignore application configuration (from figaro gem) +/config/application.yml diff --git a/Gemfile b/Gemfile index 0042fd0..119c44b 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,9 @@ gem 'aws-sdk' gem 'faker' gem 'will_paginate', '3.0.3' gem 'bootstrap-will_paginate', '0.0.6' +gem 'figaro' +gem "letter_opener", :group => :development # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' diff --git a/Gemfile.lock b/Gemfile.lock index d2b5b0c..7ca2eaf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,6 +28,7 @@ GEM activesupport (3.2.12) i18n (~> 0.6) multi_json (~> 1.0) + addressable (2.3.5) arel (3.0.2) aws-sdk (1.11.2) json (~> 1.4) @@ -60,6 +61,9 @@ GEM multi_json (~> 1.0) faker (1.1.2) i18n (~> 0.5) + figaro (0.7.0) + bundler (~> 1.0) + rails (>= 3, < 5) hike (1.2.2) i18n (0.6.4) journey (1.0.4) @@ -67,6 +71,10 @@ GEM railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.7.7) + launchy (2.3.0) + addressable (~> 2.3) + letter_opener (1.1.2) + launchy (~> 2.2) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) @@ -146,7 +154,9 @@ DEPENDENCIES coffee-rails (~> 3.2.1) devise faker + figaro jquery-rails + letter_opener paperclip (~> 3.0) pg rails (= 3.2.12) diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png new file mode 100644 index 0000000..e9b65a6 Binary files /dev/null and b/app/assets/images/logo.png differ diff --git a/app/assets/images/logo1.png b/app/assets/images/logo1.png new file mode 100644 index 0000000..bbc6978 Binary files /dev/null and b/app/assets/images/logo1.png differ diff --git a/app/assets/javascripts/pins.js.coffee b/app/assets/javascripts/pins.js.coffee index 7d0be3f..838a15f 100644 --- a/app/assets/javascripts/pins.js.coffee +++ b/app/assets/javascripts/pins.js.coffee @@ -4,4 +4,13 @@ jQuery -> $('#pins').imagesLoaded -> - $('#pins').masonry itemSelector: ".box" \ No newline at end of file + $('#pins').masonry itemSelector: ".box" + + if $('.pagination').length + $(window).scroll -> + url = $('.pagination .next_page a').attr('href') + if url && $(window).scrollTop() > $(document).height() - $(window).height() - 50 + # What to do at the bottom of the page + $('.pagination').text("Fetching more pins...") + $.getScript(url) + $(window).scroll() \ No newline at end of file diff --git a/app/assets/stylesheets/styles.css.scss b/app/assets/stylesheets/styles.css.scss index 97f536f..cda4e42 100644 --- a/app/assets/stylesheets/styles.css.scss +++ b/app/assets/stylesheets/styles.css.scss @@ -33,11 +33,12 @@ body { font-size: 11px; line-height: 1.4em; float: left; + text-align: left; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; box-shadow: 1px 1px 10px #444; - width: 214px; + /*width: 214px;*/ } .box img { @@ -49,4 +50,27 @@ body { .description { margin: 10px 0 5px; -} \ No newline at end of file +} + +.navbar .brand img { + width: 25px; + padding: 0px; + margin: 0px; +} + +/* +.navbar .brand { + width: 5%; + /*position: fixed; + max-height: 40px; + overflow: visible; + padding-left: 0; + padding-top: 0; +} +*/ +/* +.brand { + width: 5%; + padding-left: 0; +} +*/ \ No newline at end of file diff --git a/app/controllers/job_applications_controller.rb b/app/controllers/job_applications_controller.rb index 9a3e20b..6494039 100644 --- a/app/controllers/job_applications_controller.rb +++ b/app/controllers/job_applications_controller.rb @@ -2,7 +2,8 @@ class JobApplicationsController < ApplicationController # GET /job_applications # GET /job_applications.json def index - @job_applications = JobApplication.all + #@job_applications = JobApplication.all + @job_applications = current_user.job_applications.all respond_to do |format| format.html # index.html.erb @@ -13,7 +14,10 @@ def index # GET /job_applications/1 # GET /job_applications/1.json def show - @job_application = JobApplication.find(params[:id]) + #@job_application = JobApplication.find(params[:id]) + + #@user = User.find(params[:id]) + @job_application = current_user.job_applications #.page(params[:page]).per_page(10) respond_to do |format| format.html # show.html.erb @@ -24,7 +28,13 @@ def show # GET /job_applications/new # GET /job_applications/new.json def new - @job_application = JobApplication.new + #@job_application = JobApplication.new + @job_application = JobApplication.new(params[:job_application]) + @job_posting = JobPosting.find(params[:job_application][:job_posting_id]) + #@job_application.job_posting_id = @job_posting.id + #@job_application.job_posting_id = params[:job_application][:job_posting_id] + #@job_application.job_posting_id = @job_posting.id + #@job_application = JobApplication.find(params[:job_posting_id]) respond_to do |format| format.html # new.html.erb @@ -34,16 +44,26 @@ def new # GET /job_applications/1/edit def edit - @job_application = JobApplication.find(params[:id]) + @job_application = current_user.job_applications.find(params[:id]) end # POST /job_applications # POST /job_applications.json def create - @job_application = JobApplication.new(params[:job_application]) + #@job_application = JobApplication.new(params[:job_application]) + @job_application = current_user.job_applications.new(params[:job_application]) + #@job_application.job_posting_id = JobPostings.find(params[:job_posting_id]) # job_posting.id + #@job_posting = JobPosting.find(params[:job_posting_id]) + #@job_application.job_posting_id = @job_posting.id + #@job_application.job_posting_id = params[:job_application][:job_posting_id] respond_to do |format| if @job_application.save + # send email to HR person who posted the job + @job_posting = JobPosting.find(@job_application.job_posting_id) + @HR_person = User.find(@job_posting.user_id) + RecieveApplicationMailer.recieve_application_email(@HR_person, @job_application).deliver + format.html { redirect_to @job_application, notice: 'Job application was successfully created.' } format.json { render json: @job_application, status: :created, location: @job_application } else diff --git a/app/controllers/job_postings_controller.rb b/app/controllers/job_postings_controller.rb index 4231756..4df37f5 100644 --- a/app/controllers/job_postings_controller.rb +++ b/app/controllers/job_postings_controller.rb @@ -1,6 +1,6 @@ class JobPostingsController < ApplicationController before_filter :authenticate_user! - + before_filter :is_admin?, except: [:index, :show] # GET /job_postings # GET /job_postings.json def index @@ -12,6 +12,11 @@ def index end end + def my_index + @my_job_postings = current_user.job_postings.all + + end + # GET /job_postings/1 # GET /job_postings/1.json def show @@ -23,9 +28,17 @@ def show end end + def show_applications + @applications = JobApplication.find_all_by_job_posting_id(params[:job_application][:job_posting_id]) + @user = User.find(@applications[0].user_id) + @application1 = @applications[0] + @application2 = @applications[1] + end + # GET /job_postings/new # GET /job_postings/new.json def new + @job_posting = current_user.job_postings.new #@job_posting = JobPosting.new @@ -89,4 +102,12 @@ def destroy format.json { head :no_content } end end + + def is_admin? + if current_user.hirer + true + else + render :text => "You must have hiring privelages to post a job" + end + end end diff --git a/app/controllers/pins_controller.rb b/app/controllers/pins_controller.rb index 56d1f74..2e862a5 100644 --- a/app/controllers/pins_controller.rb +++ b/app/controllers/pins_controller.rb @@ -15,6 +15,7 @@ def index respond_to do |format| format.html # index.html.erb format.json { render json: @pins } + format.js end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 57ca9ef..fa0bc7d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,7 +1,13 @@ class UsersController < ApplicationController def show @user = User.find(params[:id]) - @pins = @user.pins.page(params[:page]).per_page(20) + @pins = @user.pins.page(params[:page]).per_page(10) + + respond_to do |format| + format.html # index.html.erb + #format.json { render json: @pins } + format.js + end end def new diff --git a/app/mailers/recieve_application_mailer.rb b/app/mailers/recieve_application_mailer.rb new file mode 100644 index 0000000..2bde5da --- /dev/null +++ b/app/mailers/recieve_application_mailer.rb @@ -0,0 +1,12 @@ +class RecieveApplicationMailer < ActionMailer::Base + default from: "andrew@skillchest.com" + + def recieve_application_email(user, job_application) + @user = user + @job_application = job_application + @url = 'http://www.skillchest.com' + + mail(to: @user.email, subject: 'Someone has applied for your job posting') + + end +end diff --git a/app/models/job_application.rb b/app/models/job_application.rb index 0c2762b..8ae4511 100644 --- a/app/models/job_application.rb +++ b/app/models/job_application.rb @@ -1,6 +1,7 @@ class JobApplication < ActiveRecord::Base - # attr_accessible :title, :body + attr_accessible :job_posting_id belongs_to :user + belongs_to :job_posting has_many :job_experiences diff --git a/app/models/user.rb b/app/models/user.rb index e7e62c1..6e2d58f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,8 +6,7 @@ class User < ActiveRecord::Base :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model - attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :hirer, :job_experience_attributes - # attr_accessible :title, :body + attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :hirer, :job_experiences_attributes # Validations validates_uniqueness_of :email @@ -16,10 +15,10 @@ class User < ActiveRecord::Base has_many :pins, :dependent => :destroy has_many :job_postings, :dependent => :destroy has_many :job_applications, :dependent => :destroy - has_one :job_experience, :dependent => :destroy + has_many :job_experiences, :dependent => :destroy # Nested Attributes - accepts_nested_attributes_for :job_experience + accepts_nested_attributes_for :job_experiences # :allow_destroy => true, # :reject_if => :all_blank end diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index c5c9a28..2230556 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -10,7 +10,20 @@ <%= f.input :current_password %>

Job Experience

- <%= f.fields_for :job_experience_attributes do |j| %> + <% job_experiences = JobExperience.find_all_by_user_id(current_user.id) %> + <% if job_experiences.length == 0 %> +

You have not entered any job experiences yet.

+ <% elsif job_experiences.length == 1 %> + <%= job_experiences[0].company %> + <%= job_experiences[0].job_title %> + <% elsif job_experiences.length > 1 %> + <% for x in job_experiences.length %> + <%= job_experiences[x].company %> + <%= job_experiences[x].job_title %> + <% end %> + <% end %> + + <%= f.fields_for :job_experiences_attributes do |j| %> <%= j.input :company %> <%= j.input :job_title %> <%= j.input :description, as: :text, input_html: { rows: "10" } %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 2c5e780..4de697c 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -9,8 +9,7 @@ <%= f.input :password_confirmation %> <%= f.input :hirer, as: :boolean %> - - <%= f.fields_for :job_experience_attributes do |j| %> + <%= f.fields_for :job_experiences_attributes do |j| %> <%= j.input :company %> <% end %> diff --git a/app/views/job_applications/_form.html.erb b/app/views/job_applications/_form.html.erb index d1c439a..d195ba8 100644 --- a/app/views/job_applications/_form.html.erb +++ b/app/views/job_applications/_form.html.erb @@ -1,10 +1,68 @@ -<%= simple_form_for(@job_application) do |f| %> - <%= f.error_notification %> +
+
+

Your contact info

+
+
+
+
+ <%= simple_form_for(@job_application) do |f| %> + <%= f.error_notification %> + <% user = User.find(current_user.id) %> +
<%= f.label :your_name %>
+
<%= user.name %>
+
<%= f.label :email %>
+
<%= user.email %>
+
+
+
+
-
-
+
+
+

The job you're applying for

+
+
+

Your SkillChest application

+
+
+ +
+
+
+ <%= f.label :job_title %> + <% @job_posting = JobPosting.find(params[:job_application][:job_posting_id]) #@job_application.job_posting_id) %> + <%= @job_posting.title %> + <%= f.label :job_description %> + <%= @job_posting.description %> + <% @job_application.job_posting_id = @job_posting.id %> +
+
+ +
+
+ <% if JobExperience.find_by_user_id(current_user.id) != nil %> + <%= f.label :job_experience %> + <% job_experience = JobExperience.find_by_user_id(current_user.id) %> + <%= job_experience.company %> + <%= f.label :job_title %> + <%= job_experience.job_title %> + <% end %> +
+
+
+ +
+ <%= f.hidden_field :job_posting_id, value: @job_posting.id %> +
+ +
+ <%= f.button :submit, class: "btn btn-primary" %> +
+ <%= user.id %> + <%= @job_application.job_posting_id %> +<%= params %> +<% @job_application.save %> + +<% #link_to 'Test', job_applications_job_posting_path(@job_posting) %> -
- <%= f.button :submit %> -
<% end %> diff --git a/app/views/job_applications/_job_application.html.erb b/app/views/job_applications/_job_application.html.erb new file mode 100644 index 0000000..ec574db --- /dev/null +++ b/app/views/job_applications/_job_application.html.erb @@ -0,0 +1,17 @@ +
+ <%= link_to 'View', job_application %> +

+ <%= job_application.user_id %> +

+

+ <%= job_application.job_posting_id %> + <%= job_application %> +

+ + <% if current_user.id == job_application.user_id %> + +

<%= link_to 'Edit', edit_job_application_path(job_application) %> + <%= link_to 'Destroy', job_application, method: :delete, data: { confirm: 'Are you sure?' } %> +

+ <% end %> +
diff --git a/app/views/job_applications/index.html.erb b/app/views/job_applications/index.html.erb index 201cba4..a1e0be9 100644 --- a/app/views/job_applications/index.html.erb +++ b/app/views/job_applications/index.html.erb @@ -1,21 +1,11 @@ -

Listing job_applications

+

Your Job Applications

- - - - - - +<% if @job_applications.length == 0 %> +

You have not applied for any jobs yet.

+ <%= link_to 'Apply Now', job_postings_path %> + <% end %> -<% @job_applications.each do |job_application| %> - - - - - -<% end %> -
<%= link_to 'Show', job_application %><%= link_to 'Edit', edit_job_application_path(job_application) %><%= link_to 'Destroy', job_application, method: :delete, data: { confirm: 'Are you sure?' } %>
+
+ <%= render @job_applications %> +
-
- -<%= link_to 'New Job application', new_job_application_path %> diff --git a/app/views/job_applications/new.html.erb b/app/views/job_applications/new.html.erb index b4a0dff..97e426d 100644 --- a/app/views/job_applications/new.html.erb +++ b/app/views/job_applications/new.html.erb @@ -1,4 +1,4 @@ -

New job_application

+

New Job Application

<%= render 'form' %> diff --git a/app/views/job_applications/show.html.erb b/app/views/job_applications/show.html.erb index bafd711..2b105f5 100644 --- a/app/views/job_applications/show.html.erb +++ b/app/views/job_applications/show.html.erb @@ -1,5 +1,9 @@

<%= notice %>

+<%= params %> +<%= @job_application1 = JobApplication.find(params[:id]) %> +<%= @job_application1.job_posting_id %> +<%= @job_application1.id %> <%= link_to 'Edit', edit_job_application_path(@job_application) %> | <%= link_to 'Back', job_applications_path %> diff --git a/app/views/job_experiences/_form.html.erb b/app/views/job_experiences/_form.html.erb index 105e001..578ddd2 100644 --- a/app/views/job_experiences/_form.html.erb +++ b/app/views/job_experiences/_form.html.erb @@ -8,7 +8,9 @@ <%= f.input :start_date %> +

job experiences form

<%= f.button :submit %>
+ <% end %> diff --git a/app/views/job_experiences/_my_form.html.erb b/app/views/job_experiences/_my_form.html.erb index 1f09f02..fe1bc22 100644 --- a/app/views/job_experiences/_my_form.html.erb +++ b/app/views/job_experiences/_my_form.html.erb @@ -1,7 +1,7 @@ <%= simple_form_for(@user) do |f| %>

Job Experiences

- <%= f.fields_for :job_experiences_attributes do |j| %> + <%= f.fields_for :job_experience_attributes do |j| %>
<%= j.label :company %> <%= j.text_field :company %> diff --git a/app/views/job_postings/_job_posting.html.erb b/app/views/job_postings/_job_posting.html.erb index 2a5f5ad..c86e488 100644 --- a/app/views/job_postings/_job_posting.html.erb +++ b/app/views/job_postings/_job_posting.html.erb @@ -1,11 +1,17 @@ - - <%= job_posting.title %> - <%= job_posting.description %> - <%= link_to 'Show', job_posting %> +
+ <%= link_to 'View', job_posting %> +

+ <%= job_posting.title %> +

+

+ <%= job_posting.description %> +

<% if current_user == job_posting.user %> - <%= link_to 'Edit', edit_job_posting_path(job_posting) %> - <%= link_to 'Destroy', job_posting, method: :delete, data: { confirm: 'Are you sure?' } %> +

<%= link_to 'Edit', edit_job_posting_path(job_posting) %> + <%= link_to 'Destroy', job_posting, method: :delete, data: { confirm: 'Are you sure?' } %> +

<% end %> - \ No newline at end of file +
+ diff --git a/app/views/job_postings/index.html.erb b/app/views/job_postings/index.html.erb index 8734111..590b9f1 100644 --- a/app/views/job_postings/index.html.erb +++ b/app/views/job_postings/index.html.erb @@ -1,3 +1,14 @@ +

Job Postings

+
+ <%= render @job_postings %> +
+ +
+<% if current_user.hirer %> + <%= link_to 'Post New Job', new_job_posting_path %> +<% end %> + + diff --git a/app/views/job_postings/my_index.html.erb b/app/views/job_postings/my_index.html.erb new file mode 100644 index 0000000..574c884 --- /dev/null +++ b/app/views/job_postings/my_index.html.erb @@ -0,0 +1,4 @@ +

My Job Postings

+
+ <%= render @my_job_postings %> +
\ No newline at end of file diff --git a/app/views/job_postings/show.html.erb b/app/views/job_postings/show.html.erb index e013d57..d051ec2 100644 --- a/app/views/job_postings/show.html.erb +++ b/app/views/job_postings/show.html.erb @@ -7,11 +7,21 @@

<%= @job_posting.description %>

- <%= link_to 'Apply', "#{}" %> | +

<%= params %>

<% if current_user == @job_posting.user %> <%= link_to 'Edit', edit_job_posting_path(@job_posting) %> | + <%= link_to 'Destroy', @job_posting, method: :delete, data: { confirm: 'Are you sure?' } %> | + <%= link_to 'View Applications', job_posting_applications_path(:job_application => { :job_posting_id => @job_posting.id }) %> | + <% else %> + <%= link_to 'Apply', new_job_application_path(:job_application => { :job_posting_id => @job_posting.id }) %> | <% end %> <%= link_to 'Back', job_postings_path %>
+ +
+ <%= simple_form_for(@job_posting) do |f| %> + <%= f.hidden_field :job_posting_id, value: @job_posting.id %> + <% end %> +
diff --git a/app/views/job_postings/show_applications.html.erb b/app/views/job_postings/show_applications.html.erb new file mode 100644 index 0000000..f6c5978 --- /dev/null +++ b/app/views/job_postings/show_applications.html.erb @@ -0,0 +1,28 @@ +

Applications for (this job)

+
+ <% #render @application1 %> + + <% @applications.each do |a| %> +
+ <% #a.user_id %> + <% @usertest = User.find(a.user_id) %> +

<%= @usertest.name %>

+ <%= @usertest.job_experience.company %> + <%= @usertest.job_experience.job_title %> + <%= @usertest.job_experience.description %> + <%= @usertest.job_experience.start_date %> +
+ <% end %> + +
\ No newline at end of file diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index a25a214..4416cc1 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -10,7 +10,9 @@ - SkillChest + logo SkillChest + + users form <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/show.js.erb b/app/views/users/show.js.erb new file mode 100644 index 0000000..006c85d --- /dev/null +++ b/app/views/users/show.js.erb @@ -0,0 +1,10 @@ +$boxes = $('<%= j render(@pins) %>') + +$('#pins').append( $boxes ).imagesLoaded( function(){ + $('#pins').masonry( 'reload'); +}); +<% if @pins.next_page %> + $('.pagination').replaceWith('<%= j will_paginate(@pins) %>'); +<% else %> + $('.pagination').remove(); +<% end %> \ No newline at end of file diff --git a/config/environments/development.rb b/config/environments/development.rb index 11cd31f..691a66e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -14,7 +14,19 @@ config.action_controller.perform_caching = false # Don't care if the mailer can't send - config.action_mailer.raise_delivery_errors = false + config.action_mailer.raise_delivery_errors = true + + # Change mail delivery to either :smtp, :sendmail, :file, :test + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { + address: "smtp.gmail.com", + port: "587", + domain: "gmail.com", + authentication: "plain", + enable_starttls_auto: true, + user_name: ENV['GMAIL_USERNAME_DEV'], + password: ENV['GMAIL_PASSWORD_DEV'] + } # Print deprecation notices to the Rails logger config.active_support.deprecation = :log @@ -37,4 +49,11 @@ # From Devise gem config.action_mailer.default_url_options = { :host => 'localhost:3000' } + + # For mailer + #ActionMailer::Base.delivery_method = :smtp + #ActionMailer::Base.perform_deliveries = true + #ActionMailer::Base.raise_delivery_errors = true + #ActionMailer::Base.smtp_settings = {} + end diff --git a/config/initializers/setup_mail.rb b/config/initializers/setup_mail.rb new file mode 100644 index 0000000..ce71dc2 --- /dev/null +++ b/config/initializers/setup_mail.rb @@ -0,0 +1,9 @@ +#ActionMailer::Base.smtp_settings = { +# :address => "smtp.gmail.com", +# :port => "587", +# :domain => "gmail.com", +# :user_name => "skillchest", +# :password => "", +# :authentication => "plain", +# :enable_starttls_auto => true +#} \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 1512361..9bd5caf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,9 +4,12 @@ resources :job_applications + match 'job_applications/:id' => 'job_applications#show', as: :job_application - resources :job_postings + resources :job_postings, shallow: true do + resources :job_applications + end resources :pins @@ -26,6 +29,10 @@ get 'vip' => 'pages#vip' get 'job_post' => 'pages#job_post' + + get 'my_job_postings' => 'job_postings#my_index' + + get 'job_posting_applications' => 'job_postings#show_applications' # The priority is based upon order of creation: # first created -> highest priority. diff --git a/db/migrate/20130706012945_add_job_posting_id_to_job_applications.rb b/db/migrate/20130706012945_add_job_posting_id_to_job_applications.rb new file mode 100644 index 0000000..dba6c9d --- /dev/null +++ b/db/migrate/20130706012945_add_job_posting_id_to_job_applications.rb @@ -0,0 +1,6 @@ +class AddJobPostingIdToJobApplications < ActiveRecord::Migration + def change + add_column :job_applications, :job_posting_id, :integer + add_index :job_applications, :job_posting_id + end +end diff --git a/db/migrate/20130707184331_add_company_to_job_posting.rb b/db/migrate/20130707184331_add_company_to_job_posting.rb new file mode 100644 index 0000000..b31d0c0 --- /dev/null +++ b/db/migrate/20130707184331_add_company_to_job_posting.rb @@ -0,0 +1,6 @@ +class AddCompanyToJobPosting < ActiveRecord::Migration + def change + add_column :job_postings, :company, :string + add_index :job_postings, :company + end +end diff --git a/db/schema.rb b/db/schema.rb index 9b166c9..6d2d75c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130617103741) do +ActiveRecord::Schema.define(:version => 20130707184331) do create_table "applications", :force => true do |t| t.integer "job_id" @@ -22,11 +22,13 @@ add_index "applications", ["job_id"], :name => "index_applications_on_job_id" create_table "job_applications", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "user_id" + t.integer "job_posting_id" end + add_index "job_applications", ["job_posting_id"], :name => "index_job_applications_on_job_posting_id" add_index "job_applications", ["user_id"], :name => "index_job_applications_on_user_id" create_table "job_experiences", :force => true do |t| @@ -47,8 +49,10 @@ t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "user_id" + t.string "company" end + add_index "job_postings", ["company"], :name => "index_job_postings_on_company" add_index "job_postings", ["user_id"], :name => "index_jobs_on_user_id" create_table "pins", :force => true do |t| diff --git a/logo/logo.png b/logo/logo.png new file mode 100644 index 0000000..bbc6978 Binary files /dev/null and b/logo/logo.png differ diff --git a/test/functional/recieve_application_mailer_test.rb b/test/functional/recieve_application_mailer_test.rb new file mode 100644 index 0000000..83907e6 --- /dev/null +++ b/test/functional/recieve_application_mailer_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class RecieveApplicationMailerTest < ActionMailer::TestCase + # test "the truth" do + # assert true + # end +end