Improve seeds.rb to use correct openfarm_slug
parent
c72bec8435
commit
549dfb5870
|
@ -52,12 +52,13 @@ if Rails.env == "development"
|
|||
end
|
||||
|
||||
PLANT_COUNT.times do
|
||||
veggie = Faker::Food.vegetables
|
||||
Plant.create(device: u.device,
|
||||
x: rand(40...970),
|
||||
y: rand(40...470),
|
||||
radius: rand(10...50),
|
||||
name: Faker::Food.vegetables,
|
||||
openfarm_slug: ["tomato", "carrot", "radish", "garlic"].sample)
|
||||
name: veggie,
|
||||
openfarm_slug: veggie.downcase.gsub(" ", "-"))
|
||||
end
|
||||
|
||||
Device.all.map { |device| SavedGardens::Snapshot.run!(device: device) }
|
||||
|
|
|
@ -173,7 +173,8 @@ export class EditFEForm extends React.Component<EditFEProps, State> {
|
|||
(declaration: VariableDeclaration) => {
|
||||
const body = addOrEditVarDeclaration(declarations, declaration);
|
||||
const state = { fe: { body }, specialStatusLocal: SpecialStatus.DIRTY };
|
||||
this.setState(betterMerge(this.state, state));
|
||||
const result = betterMerge(this.state, state);
|
||||
this.setState(result);
|
||||
}
|
||||
|
||||
LocalsList = () => <LocalsList
|
||||
|
@ -305,7 +306,7 @@ export class EditFEForm extends React.Component<EditFEProps, State> {
|
|||
t("Unable to save farm event."));
|
||||
return;
|
||||
}
|
||||
|
||||
// debugger;
|
||||
this.dispatch(overwrite(this.props.farmEvent, updatedFarmEvent));
|
||||
const EditFEPath = window.location.pathname;
|
||||
this
|
||||
|
|
Loading…
Reference in New Issue