Improve seeds.rb to use correct openfarm_slug

pull/1073/head
Rick Carlino 2018-12-27 10:33:09 -06:00
parent c72bec8435
commit 549dfb5870
2 changed files with 6 additions and 4 deletions

View File

@ -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) }

View File

@ -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