Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 53 #2 #83

Open
wants to merge 383 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
383 commits
Select commit Hold shift + click to select a range
e4cd217
Merge pull request #113 from sfbrigade/remove-send-reminder-from-modal
jszwedko Jan 13, 2016
0b4b3c5
Merge pull request #114 from sfbrigade/add-link-to-learn-more-to-modal
jszwedko Jan 13, 2016
58cd799
Fix apostraphes in copy
jszwedko Jan 13, 2016
616ac64
Merge pull request #116 from sfbrigade/add-system-use-code-field
jszwedko Jan 13, 2016
9bd6b60
Merge pull request #115 from sfbrigade/copy-updates-to-social
jszwedko Jan 13, 2016
7f2948b
Update favicon to be similar to map marker
jszwedko Jan 14, 2016
eb519a8
Merge pull request #118 from sfbrigade/update-favicon-to-drain
jasonlally Jan 16, 2016
81023a8
Update e-mail copy for first e-mail
jszwedko Jan 17, 2016
bc41b2e
Show guidelines when logged in
jszwedko Jan 17, 2016
f4cc05c
add bay icons where system_use_code is MS4
jasonlally Jan 16, 2016
be73630
add show/hide toggle for legend
jasonlally Jan 16, 2016
66a870b
Fix schema.rb
jszwedko Jan 17, 2016
de7e0ff
Show link on modal if thing has a link for more details
jszwedko Jan 17, 2016
d481b4c
Merge pull request #119 from sfbrigade/add-bay-icons
jasonlally Jan 17, 2016
774e6d2
Merge pull request #120 from sfbrigade/update-first-email-copy
jasonlally Jan 19, 2016
f17271f
Update feedback e-mail to [email protected]
jszwedko Jan 21, 2016
872dc1b
Update screenshot in README
kylefantastic Jan 21, 2016
843ca06
Update default mail host and devise email mailer
jszwedko Jan 21, 2016
7c81466
Merge pull request #125 from sfbrigade/new-image
jszwedko Jan 21, 2016
bda8c47
Make route work for README image
kylefantastic Jan 21, 2016
74faff2
Merge pull request #126 from sfbrigade/new-image
jszwedko Jan 21, 2016
5bd0031
Strip `Available -` from legend
jszwedko Jan 22, 2016
667b142
Merge pull request #124 from sfbrigade/update-mailer-domains
jasonlally Jan 27, 2016
1d8507a
Merge pull request #128 from sfbrigade/slight-edits-to-legend
jasonlally Jan 27, 2016
ee863fe
Merge pull request #122 from sfbrigade/update-feedback-email
jasonlally Jan 27, 2016
37d59b5
Add alt text to icons in legend
jszwedko Jan 21, 2016
0a87960
Add title text to legend icons
jszwedko Jan 28, 2016
c12ed5a
Merge pull request #123 from sfbrigade/add-alt-text-to-legends
jszwedko Jan 29, 2016
2ea92d9
update safety message in modal popup with revised text
ralam Jan 29, 2016
a181409
undo city_id column type change
ralam Jan 29, 2016
9947c92
undo change in thing migration to match master
ralam Jan 29, 2016
53b8050
Update email copy to latest
jszwedko Jan 30, 2016
bb773ab
Show guidelines in different position on mobile
jszwedko Jan 30, 2016
d5ca000
fix indentation issues in guidelines
ralam Jan 30, 2016
258fc8c
Merge pull request #130 from ralam/update-safety-message
jszwedko Jan 30, 2016
285fed4
Move reset password form to the main site
jszwedko Jan 30, 2016
2e28ee1
Added the tzinfo gem for Windows support
howdoicomputer Jan 30, 2016
58f3e36
Merge pull request #121 from sfbrigade/show-guidelines-when-logged-in
jasonlally Feb 2, 2016
140a73d
Test for redirect for PasswordsController#edit when already signed in
jszwedko Feb 2, 2016
db8b20e
Merge pull request #134 from howdoicomputer/windows-support
jszwedko Feb 2, 2016
e6bf594
Merge pull request #133 from sfbrigade/move-password-reset-form
jasonlally Feb 2, 2016
2ce2aa0
This adds a list of the users current adoptions to the search sidebar
jszwedko Feb 3, 2016
5438577
Enable the scroll wheel for zooming
jszwedko Feb 3, 2016
1bf1ae1
Bump number of drains loaded per map action to 25
jszwedko Feb 3, 2016
a4d3edf
Merge pull request #137 from sfbrigade/increase-number-of-markers
jszwedko Feb 3, 2016
a08c95c
Merge pull request #131 from sfbrigade/update-first-email-copy-redux
jszwedko Feb 4, 2016
52061f5
Add disclamier to guidelines
jszwedko Feb 4, 2016
995d3be
Merge pull request #136 from sfbrigade/enable-scrollwheel
jszwedko Feb 4, 2016
d433990
Merge pull request #135 from sfbrigade/add-list-of-things
jszwedko Feb 4, 2016
860771d
A link in the README on how get this show on the road within a Window…
howdoicomputer Feb 5, 2016
b6206f9
Merge pull request #140 from howdoicomputer/link-to-windows-dev-guide
jszwedko Feb 5, 2016
c88687e
Merge pull request #139 from sfbrigade/add-disclaimer-to-guidelines
jszwedko Feb 6, 2016
fde7c4d
Update styling of header of "my things" list
jszwedko Feb 6, 2016
124d611
Fix error with binding of edit form
jszwedko Feb 6, 2016
eb030a5
Merge pull request #152 from sfbrigade/fix-edit-form-redirect
jszwedko Feb 13, 2016
333ba8d
Merge pull request #151 from sfbrigade/update-styling-of-list-header
jszwedko Feb 13, 2016
a71af30
Ensure that console is defined
jszwedko Mar 21, 2016
d8e70a3
Switch to HTML based e-mails
jszwedko Mar 24, 2016
5d87992
Merge pull request #161 from sfbrigade/switch-to-html-emails
jszwedko Mar 26, 2016
3ade08d
Make sure the data dismiss attribute is set on dynamically injected a…
jszwedko Mar 26, 2016
d0e7882
Update error text for invalid password tokens
jszwedko Mar 26, 2016
12abc21
Add alpha banner to encourage feedback
jszwedko Mar 26, 2016
dab22c4
Merge pull request #164 from sfbrigade/make-alerts-dismissable
jszwedko Mar 26, 2016
faf8ade
Merge pull request #166 from sfbrigade/add-alpha-disclaimer
jszwedko Mar 26, 2016
2ce34db
Merge pull request #165 from sfbrigade/update-password-reset-text
jszwedko Mar 26, 2016
1a96416
Fix password reset
jszwedko Mar 26, 2016
64dd690
Split name into first and last
jszwedko Mar 26, 2016
78b4aed
Redirect to HTTPS in production
jszwedko Mar 26, 2016
de39333
Merge pull request #169 from sfbrigade/force-ssl
jszwedko Mar 26, 2016
01fc2ec
Add and configure airbrake
jszwedko Mar 26, 2016
b43156a
Update second confirmation email subject
jszwedko Mar 29, 2016
affd030
Update schema.rb and remove db/seeds
jszwedko Mar 29, 2016
df0d3f8
Merge pull request #167 from sfbrigade/split-names
jszwedko Mar 29, 2016
29b1394
Neglected to actually commit the database migration for the name split
jszwedko Mar 29, 2016
2ca16c6
update gems, addDataSF Logo addresses #106
jasonlally Apr 8, 2016
7bf1a82
update rubocop settings, fix errors related to using raise
jasonlally Apr 10, 2016
ce8abb1
Merge pull request #171 from sfbrigade/add-logo
jasonlally Apr 10, 2016
4ce072f
Update Heroku deploy to deploy to staging app
jszwedko Apr 24, 2016
21a4603
Re-add seeds for development
jszwedko Apr 24, 2016
bcee904
Change `Thing` name in rails_admin
jszwedko Jul 5, 2016
37a7690
Merge pull request #179 from sfbrigade/change-thing-name-in-rails-admin
jszwedko Jul 5, 2016
3d8b4e0
Fix link for Adopt-a-Street in adoption email
jszwedko Jul 13, 2016
e1496a3
Update social media links to open new tab
jszwedko Jul 13, 2016
c8a5ab6
Remove references to El Nino
jszwedko Jul 13, 2016
cc0e5ab
Merge pull request #184 from sfbrigade/open-social-links-in-new-tab
jszwedko Jul 13, 2016
41fd7d4
Merge pull request #185 from sfbrigade/remove-references-to-el-nino
jszwedko Jul 13, 2016
4c9e700
Merge pull request #183 from sfbrigade/update-adopt-a-street-link
jszwedko Jul 13, 2016
9933509
remove outdated and unneeded dependencies
tonyta Aug 25, 2016
d2094a6
rails_12factor is only needed in production (Heroku requirement)
tonyta Aug 25, 2016
f9ba669
geokit is auto-required by Gemfile
tonyta Aug 25, 2016
3fd6ede
obsolete ruby version
tonyta Aug 25, 2016
493e226
`#deliver` is deprecated. using new Rails 5 `#deliver_later`
tonyta Aug 25, 2016
407106b
updates spring and its binstubs
tonyta Aug 25, 2016
49482ea
deletes obsolete binstubs and executables
tonyta Aug 25, 2016
328971b
Merge pull request #186 from tonyta/gemfile-cull
jszwedko Aug 26, 2016
c53f004
Merge pull request #188 from tonyta/spring-bin-update
jszwedko Aug 26, 2016
53d9e78
Merge pull request #187 from tonyta/mailer-deprecations
jszwedko Aug 26, 2016
3e5711f
Add content about the project background
jszwedko Sep 24, 2016
fae489b
Merge pull request #191 from sfbrigade/add-background-link
jszwedko Sep 24, 2016
2243524
Remove alpha well
jszwedko Oct 4, 2016
8438406
Make logo link to home
jszwedko Oct 4, 2016
b72820a
Add Gitter badge
gitter-badger Oct 22, 2016
0ea7c8c
Merge pull request #194 from gitter-badger/gitter-badge
jszwedko Oct 22, 2016
7f77dc3
Update language in background about tools and training
jszwedko Oct 27, 2016
c39d24d
Add short video to sidebar
jszwedko Oct 27, 2016
30070d5
Allow the user to search before signing in (#196)
jszwedko Nov 27, 2016
78639d9
Fix syntax error in de.yml
jszwedko Dec 10, 2016
5a32412
Restrict to locale :en
jszwedko Dec 17, 2016
5dbfb93
Update first adoption e-mail copy
jszwedko Nov 27, 2016
1c85d61
Add some more space between social media images in adoption email
jszwedko Dec 3, 2016
ecc2e19
Update language on the learn more button
jszwedko Dec 17, 2016
1393638
Replace link to learn more with a button
jszwedko Dec 17, 2016
d753078
Update guidelines copy
jszwedko Dec 17, 2016
782c451
Update background copy
jszwedko Dec 17, 2016
5d98a1b
Add inline styles for header sizes
jszwedko Dec 17, 2016
d53c633
Remove feedback link from sidebar
jszwedko Dec 17, 2016
834badd
Remove link to guidelines from background
jszwedko Dec 17, 2016
df79456
Forgot to add the hashtags to the guidelines page
jszwedko Dec 17, 2016
c014764
Remove github logo from background page
jszwedko Dec 26, 2016
85fe257
Fix header weighting
jszwedko Dec 29, 2016
0e8c6d0
Make the lead paragaph normal sized in guidelines
jszwedko Dec 29, 2016
56667a7
Guidelines proofreading updates
jszwedko Dec 29, 2016
7e34c44
Update background button text
jszwedko Dec 29, 2016
5665903
Remove duplicate paragraph from background
jszwedko Jan 5, 2017
41d88fd
Remave StormPrep hashtag from guidelines
jszwedko Jan 5, 2017
b3ab049
Additional copy updates to first adoption email
jszwedko Jan 5, 2017
12f0176
Update sender address to have human readible name
jszwedko Jan 9, 2017
04dc1e9
Update second e-mail text copy
jszwedko Jan 9, 2017
621ec32
Add docker development configuration. (#220)
dsummersl Jan 17, 2017
9d49262
Add number of adopted drains to sidebar (#216)
jszwedko Jan 27, 2017
6ada9d4
Make last name a required field for new users (#223)
jszwedko Jan 28, 2017
249e451
Copy edits for the first adoption email
jszwedko Feb 4, 2017
f3fc31a
Re-add current_user_id hidden field
jszwedko Feb 4, 2017
d5e33be
Fix tagline modal displaying
jszwedko Feb 6, 2017
c6f4e2c
Just show date for adopted ticker
jszwedko Feb 11, 2017
86ae6b4
Use local_time gem in ticker
jszwedko Feb 11, 2017
8508877
Have links open new window 212 (#227)
Mar 4, 2017
dce336a
Adding a migration (via rails g migration) in order to rename db colu…
Mar 4, 2017
6aeb91c
Deleting previous migration, which renamed db columns, and adding adm…
Mar 6, 2017
3db99fe
Fixing spacing (travis ci build failed)
Mar 6, 2017
400402b
Added a label MaximoID for Admin interface City field
Mar 23, 2017
5d72044
Removing a line break... again :'-(
Mar 23, 2017
19b282d
Move JavaScript constants into their own file
EvanHahn Mar 17, 2017
5a5d75a
Updated load_drains rake task.
squidarth Nov 19, 2016
523a847
Pass rubocop checks.
squidarth Nov 20, 2016
2058021
Test new drain creation.
squidarth Nov 21, 2016
6018902
Improved drain deletion.
squidarth Dec 5, 2016
a61b7f1
Allow reintroducing deleted rains.
squidarth Dec 20, 2016
3595ec5
Added thing email report, refactored load_drains.
squidarth Dec 21, 2016
d471c7b
Remove unused view file
jszwedko Jan 9, 2017
4504c34
Generalize the new import logic a bit with respect to the "thing"
jszwedko Jan 9, 2017
d32c8bf
Do not overwrite adopted name during import
jszwedko Jan 9, 2017
973d37e
Add test for adopted drain deletion during import
jszwedko Jan 9, 2017
8479505
Neglected to generalize thing update report
jszwedko Jan 9, 2017
940b1b4
Add import test for invalid response
jszwedko Jan 9, 2017
c7e661a
Rely on Postgresql more during drain imports
jszwedko Feb 13, 2017
fd56a7d
Refactor import into a ThingImporter
jszwedko Feb 14, 2017
671dfd9
Use postgresql 9.6 in Travis
jszwedko Feb 14, 2017
2067ab0
Use Trusty in CI
jszwedko Feb 14, 2017
59309d3
Added new svg images (but using only one), modifying css, and index HTML
Apr 20, 2017
b840ef5
Re-commenting paranoia method
Apr 20, 2017
ad299af
Replaced SFDPW logo with a better one
Apr 20, 2017
e6aa8e8
Added DT logo and translations, and removed the horizonal scrollbar o…
Apr 21, 2017
0cf4ec3
Prepend N- to the city ids for the automated email
jszwedko Apr 24, 2017
8e69c3a
Set the max-height of the adopted drain list
jszwedko Apr 25, 2017
6cc54c2
Allow viewing of deleted entities in Rails Admin
jszwedko Apr 26, 2017
d392eb4
Changing "remember_me" checkbox detection method
Apr 25, 2017
b745320
Added integration test for login with/without remembering
Apr 26, 2017
c0ec6a6
DOuble quotes to single, to satisfy Travis CI build
Apr 26, 2017
cc841f9
Remove secret_token initializer
jszwedko Jul 14, 2017
92e20f9
Adding app.json to configure Heroku review apps
jszwedko Jul 14, 2017
13289cf
Use Google Maps Javascript API key
jszwedko Jul 14, 2017
798b72b
Adjust user seed data
jszwedko Jul 14, 2017
ee00d83
Update e-mail copy to latest provided copy
jszwedko Jul 14, 2017
16e6175
Require HEROKU_APP_NAME
jszwedko Jul 14, 2017
83558ab
Remove program background modal popup
jszwedko Jul 14, 2017
edf1d96
Move Contact Us section to bottom of background
jszwedko Aug 9, 2017
7588751
Make program background button behave more like a normal button
jszwedko Aug 9, 2017
d22c9d2
Update SFWater logo to link to Adopt-a-Drain page
jszwedko Aug 11, 2017
9557e5b
Lock gem versions and update gems
jszwedko Aug 28, 2017
96037c5
Lint with up-to-date rubocop
jszwedko Aug 28, 2017
59d0235
Bump airbrake from 5.8.1 to 6.2.1
dependabot[bot] Aug 31, 2017
adcfaf8
Bump haml from 4.0.7 to 5.0.2
dependabot[bot] Aug 31, 2017
09e5a34
Bump local_time from 1.0.3 to 2.0.0
dependabot[bot] Aug 31, 2017
81895a3
Require local-time rather than local_time
jszwedko Aug 31, 2017
c6bb9aa
Update formating of drain e-mails
jszwedko Sep 18, 2017
05b9728
Update nokogiri
jszwedko Sep 21, 2017
f0a428c
Move user adoption name to separate field
jszwedko Sep 26, 2017
0b5e688
Fix broken README link for branching
jszwedko Sep 26, 2017
6b7bb65
Bump rails from 4.2.9 to 4.2.10
dependabot[bot] Oct 1, 2017
20fb05b
Bump haml from 5.0.2 to 5.0.3
dependabot[bot] Oct 1, 2017
c9b8dbb
Bump airbrake from 6.2.1 to 7.0.2
dependabot[bot] Oct 1, 2017
d3abefc
Bump rubocop from 0.49.1 to 0.50.0
dependabot[bot] Oct 1, 2017
680b31f
Set :dependent for has_many relationships
jszwedko Oct 1, 2017
00b9b27
Fix db rake step
kmcurry Nov 1, 2017
0ea76e8
Bump haml from 5.0.3 to 5.0.4
dependabot[bot] Nov 1, 2017
112e6fb
Bump webmock from 3.0.1 to 3.1.0
dependabot[bot] Nov 1, 2017
c9a0d0f
Bump rubocop from 0.50.0 to 0.51.0
dependabot[bot] Nov 1, 2017
d0903df
Bump skylight from 1.3.1 to 1.4.3
dependabot[bot] Nov 1, 2017
6caf7cf
Bump airbrake from 7.0.2 to 7.1.0
dependabot[bot] Nov 1, 2017
45b1156
Add rake task for migrating deleted adoptions
jszwedko Nov 8, 2017
fb53405
chore(dependencies): Bump webmock from 3.1.0 to 3.1.1
dependabot[bot] Nov 27, 2017
9a69024
chore(dependencies): Bump paranoia from 2.3.1 to 2.4.0
dependabot[bot] Nov 27, 2017
fd3dc2a
chore(dependencies): Bump sass-rails from 5.0.6 to 5.0.7
dependabot[bot] Nov 27, 2017
8857f0a
chore(dependencies): Bump skylight from 1.4.3 to 1.4.4
dependabot[bot] Nov 27, 2017
b5e2534
chore(dependencies): Bump puma from 3.10.0 to 3.11.0
dependabot[bot] Nov 28, 2017
8d0d963
Bump uglifier from 3.2.0 to 4.1.2
dependabot-support Jan 1, 2018
bda2eb2
Bump skylight from 1.4.4 to 1.5.0
dependabot-support Jan 1, 2018
7bfdc42
Bump rubocop from 0.51.0 to 0.52.1
dependabot-support Jan 1, 2018
fc5f68a
Bump airbrake from 7.1.0 to 7.1.1
dependabot-support Jan 1, 2018
82fa46f
Switch from Haversine formula to earth_distance Postgres extension
jszwedko Jan 23, 2018
31f4958
Bump puma from 3.11.0 to 3.11.2
dependabot-support Feb 1, 2018
8117715
Bump byebug from 9.1.0 to 10.0.0
dependabot-support Feb 1, 2018
2ef7c2d
Bump webmock from 3.1.1 to 3.3.0
dependabot-support Feb 1, 2018
07e574c
Bump airbrake from 7.1.1 to 7.2.0
dependabot-support Feb 1, 2018
559cd46
Bump uglifier from 4.1.2 to 4.1.5
dependabot-support Feb 1, 2018
905f238
Update nokogiri to handle security vulnerability
jszwedko Feb 11, 2018
ccb0655
Remove POI business markers
jszwedko Feb 27, 2018
4b181c0
Upgrade rails-html-sanitizer
jszwedko Mar 25, 2018
bb9f80e
Bump airbrake from 7.2.0 to 7.2.1
dependabot-support Mar 1, 2018
1a85d0f
Bump uglifier from 4.1.5 to 4.1.6
dependabot-support Mar 1, 2018
61c9410
Bump skylight from 1.5.0 to 1.5.1
dependabot-support Mar 1, 2018
5cd41c2
Bump rails_admin from 1.2.0 to 1.3.0
dependabot-support Mar 25, 2018
0f4d59b
Bump skylight from 1.5.1 to 1.6.0
dependabot-support Apr 1, 2018
92eb9a6
Bump puma from 3.11.2 to 3.11.3
dependabot-support Apr 1, 2018
3aa22fb
Bump byebug from 10.0.0 to 10.0.2
dependabot-support Apr 1, 2018
5ac0bdb
Bump uglifier from 4.1.6 to 4.1.8
dependabot-support Apr 1, 2018
0b38874
Bump rubocop from 0.52.1 to 0.54.0
dependabot-support Apr 1, 2018
fe5f7b7
Fix new Rubocop errors for 0.54.0
jszwedko Apr 1, 2018
a665a33
Additional rubocop fixes
jszwedko Apr 1, 2018
65762c4
A few more rubocop fixes
jszwedko Apr 1, 2018
a7a906f
Bump devise from 3.5.10 to 4.3.0
dependabot[bot] Aug 31, 2017
34cd02e
Show errors on forgot password form
jszwedko Aug 31, 2017
66c920b
Address devise deprecation warnings
jszwedko Apr 2, 2018
05c572c
Update devise to 4.4.3
jszwedko Apr 2, 2018
cea21df
Fix flakey test
jszwedko Apr 2, 2018
5ed4266
Upgrade ruby to 2.5.1
jszwedko Apr 2, 2018
f701e7a
Remove Travis configured rvm ruby version
jszwedko Apr 2, 2018
ed95b46
Downgrade to Ruby 2.5.0
jszwedko Apr 2, 2018
5736f5d
Upgrade devise
jszwedko Apr 2, 2018
881d4c0
Hide user last name from adopted drain info box
jszwedko Apr 4, 2018
f905472
Bump dotenv-rails from 2.2.1 to 2.4.0
dependabot-support May 1, 2018
b58aadf
Bump webmock from 3.3.0 to 3.4.0
dependabot-support May 1, 2018
93a5ead
Bump paranoia from 2.4.0 to 2.4.1
dependabot-support May 1, 2018
9f7f0bd
Bump uglifier from 4.1.8 to 4.1.10
dependabot-support May 1, 2018
64b9a03
Bump skylight from 1.6.0 to 2.0.0
dependabot-support May 1, 2018
b6ea1b3
Bump airbrake from 7.2.1 to 7.3.0
dependabot-support May 1, 2018
ebbaa2f
Bump puma from 3.11.3 to 3.11.4
dependabot-support May 2, 2018
a96ba45
Bump rubocop from 0.54.0 to 0.55.0
dependabot-support May 2, 2018
1ad6981
Add simple rake task to fetch adopter information
jszwedko May 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/models/thing.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'geokit'
require 'obscenity/active_model'

class Thing < ActiveRecord::Base
extend Forwardable
Expand Down
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require File.expand_path('../boot', __FILE__)

require 'rails/all'
require 'obscenity/active_model'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20160111062953_add_system_use_code_to_things.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddSystemUseCodeToThings < ActiveRecord::Migration
def change
add_column :things, :system_use_code, :string
end
end
9 changes: 5 additions & 4 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 5) do
ActiveRecord::Schema.define(version: 20160111062953) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -47,10 +47,11 @@
t.datetime "created_at"
t.datetime "updated_at"
t.string "name"
t.decimal "lat", precision: 16, scale: 14, null: false
t.decimal "lng", precision: 17, scale: 14, null: false
t.integer "city_id"
t.decimal "lat", precision: 16, scale: 14, null: false
t.decimal "lng", precision: 17, scale: 14, null: false
t.string "city_id"
t.integer "user_id"
t.string "system_use_code"
end

add_index "things", ["city_id"], name: "index_things_on_city_id", unique: true, using: :btree
Expand Down
27 changes: 13 additions & 14 deletions lib/tasks/data.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'rake'

namespace :data do
require 'open-uri'
require 'csv'
Expand All @@ -12,26 +14,23 @@ namespace :data do
drains.each do |drain|
next unless ['Storm Water Inlet Drain', 'Catch Basin Drain'].include?(drain['Drain_Type'])

name = drain['Drain_Type']
city_id = drain['PUC_Maximo_Asset_ID']
city_id.gsub!('N-', '') # Strip `N-` from the Asset ID
location = drain['Location']
location.delete!('(') # Cleanup brackets
location.delete!(')')

latlng = location.split(',')
lat = latlng[0].strip
lng = latlng[1].strip
(lat, lng) = drain['Location'].delete('()').split(',').map(&:strip)

thing_hash = {
name: name,
city_id: city_id,
name: drain['Drain_Type'],
system_use_code: drain['System_Use_Code'],
lat: lat,
lng: lng,
}

thing = Thing.create!(thing_hash)
puts "Created Thing #{thing.id} - #{thing.name}"
thing = Thing.where(city_id: drain['PUC_Maximo_Asset_ID'].gsub!('N-', '')).first_or_initialize
if thing.new_record?
puts "Updating thing #{thing_hash[:city_id]}"
else
puts "Creating thing #{thing_hash[:city_id]}"
end

thing.update_attributes!(thing_hash)
end
end
end