Skip to content

Commit

Permalink
fix(bugs): Minor bug fixes
Browse files Browse the repository at this point in the history
* Fixes a bug where things are editable because the var was statically `true`

* Fixes a bug in seeds where no comments would be created

* Fixes a seeds bug which used random numbers instead of sampling from `Business.all`
  • Loading branch information
mrmod committed Apr 12, 2020
1 parent 8a043c5 commit 23f3843
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
13 changes: 10 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Things look good so far. Below are the things we talked about and wanted to get
* Adding an image to an Event fails to reload the comment data
* Private posts feature ; tagging in people
* Refresh of resourceful pages loses the store data since there's no resource information in the route
* Editability of Events, Posts, and Comments isn't checking permissions properly

# Things

Expand All @@ -15,9 +16,9 @@ Things look good so far. Below are the things we talked about and wanted to get

# Features

* A side bar of post topics on the left for Posts section (crime & safety, marketplace, civic information, etc)
* A side bar of post topics on the left for Posts section (crime & safety, marketplace, civic information, etc) [Done]
* Events calendar
* Neighborhood creation
* Neighborhood creation [Done]
* Posts should show up for the Neighboorhoods selected
* A side bar allowing the Neighborhood selection in Posts and Events

Expand All @@ -34,13 +35,19 @@ rails g migration AddLatLongToLocation lat:decimal long:decimal
rails g migration AddPrimaryToLocation primary:boolean
sed -i -e 's/null: false/null: true/' db/migration/*add_region_to_location.rb
```

s
### Dev Api Key

`GOOGLE_API_CREDENTIALS`

Restricted to Maps Javascript API from localhost or localhost/*

### Goals

* Ability to create regions [Done]
* Ability to see regions for business locations [Done]
* Ability to create locations for a business

# Locality

* Select Event radius to display Events from
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
},
computed: {
isEditor: function() {
return true // if the current user is the same as the comment employee_id
return this.$currentUser.employee_id === this.comment.employee_id
}
},
created: function() {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ViewRegion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
return {
map: null,
drawingManager: null,
zoom: 6,
zoom: 10,
}
},
props: {
Expand Down
4 changes: 2 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
description: Faker::Lorem.paragraph,
start_time: Faker::Time.forward(days: (rand * 3).to_i),
end_time: Faker::Time.forward(days: (rand * 20).to_i + 4),
business: Business.find((rand * Business.count).to_i + 1),
business: Business.all.sample,
)
(rand * 5).to_i.times do |n|
((rand * 5)+1).to_i.times do |n|
employee = e.business.employees.sample
if n % 2 == 0
e.comments.create!(text: Faker::Lorem.paragraph, employee: employee)
Expand Down

0 comments on commit 23f3843

Please sign in to comment.