Skip to content

Commit

Permalink
Make some textual and style updates to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
getschomp committed Jan 12, 2017
1 parent 8c5ce3a commit 3e1184c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 14 deletions.
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,54 @@ ERB diagram to be developed

## Up and Running


### Install

Make sure you have:
* Ruby version: `2.3.1`

* Rails version: `5`

* Databases:
#### Postgresql
### Database Setup

##### Postgresql

With postgres installed, initialize the database with:
`$ rake db:create`
`$ rake db:migrate`

#### neo4j
Download the dmg from the neo4j website then:
##### neo4j
Since this is a less typical setup, and has a few gotchyas I'll cover it in more detail.
Download the dmg from the neo4j website then
`$ brew install neo4j`

If you are using zsh you should alias rake or put noglob before each neo4j rake task
`alias rake='noglob bundle exec rake'`

Install the databases for each environment into the project
`rake neo4j:install[community-3.1.0,test]`
`rake neo4j:install[community-3.1.0,development]`
```ruby
rake neo4j:install[community-3.1.0,test]
rake neo4j:install[community-3.1.0,development]
```

Configure and migrate
`rake neo4j:config[test,7474]`
`rake neo4j:config[development,7575]`
`rake neo4j:disable_auth[development]`
`rake neo4j:disable_auth[test]`
`rake neo4j:migrate:all`
```ruby
rake neo4j:config[test,7474]
rake neo4j:config[development,7575]
rake neo4j:disable_auth[development]
rake neo4j:disable_auth[test]
rake neo4j:migrate:all
```

Run the Databases
`rake neo4j:start[test]`
`rake neo4j:start[development]`
```ruby
rake neo4j:start[test]
rake neo4j:start[development]
```

You should be able to navigate to `http://localhost:7575` or `http://localhost:7474` in your browser and see a neo4j ui with a display of any data and basic tutorials.

You should be able to navigate to the correct local ports in your browser and see a ui with basic tutorials.
#### Running the api

* Run the server with: `rails s` and navigate to `http://localhost:3001`
(The default port is set to 3001 so that a second server can be easily run alongside the api using rails defaults)
Expand Down
30 changes: 30 additions & 0 deletions app/models/nodes/stop.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module Nodes
class Stop
include Neo4j::ActiveNode

property :service_id, type: Integer
property :monday, type: Integer
property :tuesday, type: Integer
property :wednesday, type: Integer
property :thursday, type: Integer
property :friday, type: Integer
property :saturday, type: Integer
property :sunday, type: Integer
property :start_date, type: String
property :end_date, type: String

property :created_at
property :updated_at

validates :service_id, presence: true
validates :monday, presence: true, inclusion: { in: 0..1}
validates :tuesday, presence: true, inclusion: { in: 0..1}
validates :wednesday, presence: true, inclusion: { in: 0..1}
validates :thursday, presence: true, inclusion: { in: 0..1}
validates :friday, presence: true, inclusion: { in: 0..1}
validates :saturday, presence: true, inclusion: { in: 0..1}
validates :sunday, presence: true, inclusion: { in: 0..1}
validates :start_date, presence: true, length: { is: 8 }
validates :end_date, presence: true, length: { is: 8 }
end
end

0 comments on commit 3e1184c

Please sign in to comment.