Uh oh!
There was an error while loading. Please reload this page.
Issue365 add jobs - #366
Conversation
jjhampton
commented
Jun 2, 2018
@leenyburger@hpjaj Any reason that |
hpjaj
commented
Jun 2, 2018
@jjhampton - We would create a few constants to ensure data integrity. And a dropdown in ActiveAdmin to choose from. That said, we can definitely switch to a If we don't see any value there, then I agree, changing the column name to |
jjhampton
commented
Jun 2, 2018
@hpjaj I've already coded up the front-end stuff to filter on for |
| column :remote | ||
| actions | ||
| end |
There was a problem hiding this comment.
Can you pls add a form for creating/updating. Here is an example:
https://github.com/OperationCode/operationcode_backend/blob/master/app/admin/code_school.rb#L28-L45
There was a problem hiding this comment.
When I add the form and try to add a job I get the following error: "
"exception": "#<ActionView::Template::Error: To use the :country input, please install a country_select plugin, like this one: https://github.com/stefanpenner/country_select>",
Should I install that gem, or are we already using something else?
There was a problem hiding this comment.
@hpjaj I don't see where you responded here. If @leenyburger issue has been addressed, disregard just getting visibility.
| @@ -0,0 +1,11 @@ | |||
| module Api | |||
There was a problem hiding this comment.
Did this extra controller sneak in?
| @@ -31,6 +31,9 @@ | |||
| Service.create!(:name => service) | |||
| end | |||
There was a problem hiding this comment.
Can you pls add a delete_all call for Job i.e. https://github.com/OperationCode/operationcode_backend/blob/master/db/seeds.rb#L9-L16
| # Create jobs | ||
| Job.create!(title: "A great job", source_url: "www.applyhere.com", source: "Company A", city: "Virginia Beach", state: "VA", country: "USA", description: "Our job is fun!", status: "active", remote: "false") | ||
| # Create team members |
There was a problem hiding this comment.
As well as a reporting call, i.e. https://github.com/OperationCode/operationcode_backend/blob/master/db/seeds.rb#L57-L64
| @@ -0,0 +1,3 @@ | |||
| class Job < ApplicationRecord | |||
| acts_as_taggable_on | |||
There was a problem hiding this comment.
Can you pls add a method similar to this one in here:
https://github.com/OperationCode/operationcode_backend/blob/master/app/models/user.rb#L130-L141
As well as an associated test. This will confirm that a given job can have tags (plural) added to it, and then we can use this method to query for any jobs that match the search criteria.
| require 'test_helper' | ||
| class JobTest < ActiveSupport::TestCase | ||
| # test "the truth" do |
There was a problem hiding this comment.
Can you pls create a test in here confirm that the associated Factory is valid. All this would need to do is:
- use the factory to create a new
Job - assert that it is
valid?
This keeps us honest with respect to any validations that we add to the Job model class, and its associated Factory staying in step with those requirements.
re: @jjhampton 's comment here: #366 (comment) I agree, would be easier to go the If not, then @leenyburger you'll want to follow this pattern in order to implement choices for After this piece is wrapped up, this PR should be ready to ship. |
dmarchante
commented
Aug 21, 2018
Can you review the conflicts and address the final comments from @hpjaj@leenyburger? |
leenyburger
commented
Aug 22, 2018
@dmarchante Yes. I'm out of town until next week but can take a look then. |
apex-omontgomery
commented
Sep 14, 2018
Hi @leenyburger how is this going? Is there anything blocking you that I can assist with? |
leenyburger
commented
Sep 16, 2018
@wimo7083 No blockers, just haven't been able to find the time. Making up for hurricane delay next week, can take a look the week of the 24th. |
leenyburger
commented
Oct 1, 2018
@wimo7083 I'm not going to be able to get to this in a timely manner. Sorry to leave you hanging! |
apex-omontgomery
commented
Oct 3, 2018
Okay so I'm going to make the decision we want to use a boolean instead of a string. I think this would align better with what the frontend needs. For this I'd recommend:
If nobody objects I'd like to finish this up. |
robbkidd
commented
Oct 3, 2018
I have a maybe philosophical question: what does it mean for a job to have an "active status"? |
kylemh
commented
Oct 5, 2018
@robbkidd Agreed. I feel like that field is unnecessary. I'd prefer a self-cleaning database. We could end up having tons of inactive jobs |
apex-omontgomery
commented
Oct 5, 2018
Since we don't know when the job will expire. it's probably best to make it adjustable. I can add something to the route so we eliminate innactive jobs. I went with |
🤔 One option for flagging jobs as either open or closed is to record the date on which it closed. This is a bit like a technique named "soft delete." It would involve adding a datetime column classJobscope:open,->{where(closed_at: nil)}scope:closed,->{where.not(closed_at: nil)}defopen?self.closed_at.nil?enddefclosed?
!open?endendThere is an |
Uh oh!
There was an error while loading. Please reload this page.
| test: bg | ||
| docker-compose run operationcode-psql bash -c "while ! psql --host=operationcode-psql --username=postgres -c 'SELECT 1'; do sleep 5; done;" | ||
| docker-compose run ${RAILS_CONTAINER} bash -c 'export RAILS_ENV=test && rake db:test:prepare && rake test && rubocop' | ||
| $(DOCKER_COMPOSE) run operationcode-psql bash -c "while ! psql --host=operationcode-psql --username=postgres -c 'SELECT 1'; do sleep 5; done;" |
There was a problem hiding this comment.
I'm starting to feel odd about this.
As this gets bigger it should really be things in their own target, or in a bash script. Large makefiles with lots of distractions are hard to understand. Plus hiding tests behind a very long bash script means I can't pass in parameters to run test groups.
| city Faker::Address.city | ||
| state Faker::Address.state | ||
| country Faker::Address.country | ||
| description Faker::Lorem.paragraph |
There was a problem hiding this comment.
All the attributes being set above this comment should get assigned with block to evaluate the Faker data lazily each time the factory is used instead of at test load time. Otherwise all jobs created with this factory will have the same values.
e.g. title { Faker::Lorem.characters(7) }
| @@ -0,0 +1,10 @@ | |||
| class Job < ApplicationRecord | |||
There was a problem hiding this comment.
Does having this in the models section of the code base make it clear enough that this is separate from Sidekiq Jobs?
There was a problem hiding this comment.
I think so, yes. Though, it might be helpful to rename the background jobs from Job(s) to Worker(s).
There was a problem hiding this comment.
Are you sure you don't want JobJobs?
There was a problem hiding this comment.
Now that you mention it, maybe WorkJobber.
Description of changes
Added job functionality.
Includes the following (copied from issue):
new db table
new GET index endpoint
new resource in ActiveAdmin
test coverage
API docs
Jobs table to include:
title
source_url
source
city
state
country
description
status (i.e. active, inactive)
remote
Also include tagging.
Issue Resolved
Fixes#365