I am trying to create a record if none exists.
@construction = Construction.create!(:bom_created => false,
:recipe_created => false,
:cost_rollup_complete => false,
:opportunity_id => $current_opportunity)
bom_created, recipe_created and cost_rollup_complete are mandatory fields per my model.
validates_presence_of :bom_created
validates_presence_of :recipe_created
validates_presence_of :cost_rollup_complete
I thought I was Ok with passing the values as part of the create but I am getting
ActiveRecord::RecordInvalid in ConstructionsController#show
Validation failed: Bom created can't be blank, Recipe created can't be blank, Cost rollup complete can't be blank
Rails.root: C:/Users/cmendla/RubymineProjects/product_development
Application Trace | Framework Trace | Full Trace
app/controllers/constructions_controller.rb:76:in `show'
Request
Parameters:
{"id"=>"1"}