Storm/app/services/initial_account_setup.rb
Andrew Fomera 87ca860557 Adds Settings and starts on Users Controllers (#1)
* Update app to run on 3000 by default instead of 5000

* handle yanked rb-fsenvent gem version

* Add user controller route

* Adds settings/users controllers

* Start adding settings table

* Adds settings creator to ensure one is created on db migrate

* whoops, validate only before creation

* Adds editing of settings

* lint

* cleanup

* Fix tests

* use the correct styling for tests

* update settings test syntax

* setting model test

* double quotes for html

* test for updating settings

* post -> patch

* Basic user list view

* using the github attr_encrypted fixes the deprecation messages for 5.1

* table view for users

* derp fix heading

* review changes

* cut out creating a setting...

* rename service class.

* update Settings form.

* add url to find slack webhook url

* fix indention

* re-organizate Settings form.

* change autofocus.

* add test/reports to gitignore
2017-07-14 15:15:36 -05:00

30 lines
495 B
Ruby

# InitialAccountSetup
class InitialAccountSetup
attr_reader(:current_user, :current_path)
def initialize(current_user, current_path)
@current_user = current_user
@current_path = current_path
end
def required?
return false if current_user.present?
User.none? && browsing_required_path?
end
private
def browsing_required_path?
!safe_paths.include?(current_path)
end
def safe_paths
[
'/',
'/users/sign-up',
'/users'
]
end
end