Default belongs_to association value

Tags: #<Tag:0x00007f1141cf7020> #<Tag:0x00007f1141cf6e40>


Job Model

schema "jobs" do
  belongs_to :status, Test.JobStatus,
    foreign_key: :status_id,
    references: :id,
    type: :string

and I have a status Model as:

@primary_key {:id, :string, autogenerate: false}
  schema "job_statuses" do
    field :title, :string
    field :description, :string

When I am inserting the job I need to put default job status(if its not in params). I know about defaults in belongs_to association but this thing is for perhaps to assign default values when you are assiging a relationship. Can any one point me how I can put default status for any newly created job(assumed job status id is acitve and its already in the database ) . sample is already here