{"action":"created","issue":{"url":"https://api.github.com/repos/sparc-request/sparc-request/issues/1149","repository_url":"https://api.github.com/repos/sparc-request/sparc-request","labels_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/1149/labels{/name}","comments_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/1149/comments","events_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/1149/events","html_url":"https://github.com/sparc-request/sparc-request/pull/1149","id":262844677,"number":1149,"title":"Settings Implementation","user":{"login":"kyle-glick","id":12898988,"avatar_url":"https://avatars3.githubusercontent.com/u/12898988?v=4","gravatar_id":"","url":"https://api.github.com/users/kyle-glick","html_url":"https://github.com/kyle-glick","followers_url":"https://api.github.com/users/kyle-glick/followers","following_url":"https://api.github.com/users/kyle-glick/following{/other_user}","gists_url":"https://api.github.com/users/kyle-glick/gists{/gist_id}","starred_url":"https://api.github.com/users/kyle-glick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyle-glick/subscriptions","organizations_url":"https://api.github.com/users/kyle-glick/orgs","repos_url":"https://api.github.com/users/kyle-glick/repos","events_url":"https://api.github.com/users/kyle-glick/events{/privacy}","received_events_url":"https://api.github.com/users/kyle-glick/received_events","type":"User","site_admin":false},"labels":[{"id":635974469,"url":"https://api.github.com/repos/sparc-request/sparc-request/labels/MUSC","name":"MUSC","color":"0052cc","default":false},{"id":636827585,"url":"https://api.github.com/repos/sparc-request/sparc-request/labels/Side%20Branch%20Project","name":"Side Branch Project","color":"c2e0c6","default":false},{"id":674066109,"url":"https://api.github.com/repos/sparc-request/sparc-request/labels/version%203.0.0b","name":"version 3.0.0b","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-04T16:08:02Z","updated_at":"2017-10-04T16:39:16Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/sparc-request/sparc-request/pulls/1149","html_url":"https://github.com/sparc-request/sparc-request/pull/1149","diff_url":"https://github.com/sparc-request/sparc-request/pull/1149.diff","patch_url":"https://github.com/sparc-request/sparc-request/pull/1149.patch"},"body":"Story:\r\nhttps://www.pivotaltracker.com/story/show/147540421\r\n\r\nAll values from `application.yml` have been moved to the database as `Setting`s. Settings contain a `key`, `value`, `data_type`, `friendly_name`, `description`, `group`, `version`, `parent_key`, and `parent_value`.\r\n\r\nThe `key` is considered the primary key of a Setting. You find it by using `#find_by_key(<String>)`. We used a custom `value` override to return the value of a Setting based on the Setting's data_type.\r\n\r\nThe `friendly_name` and `description` will be used for the eventual User Interface. These provide human-readable names and descriptions of each Setting for users to understand what the Setting does.\r\n\r\nThe `group` attribute can be used to define groups of Settings, i.e. considering them a family of Settings. This could allow us to put similar settings together in the eventual User Interface.\r\n\r\nThe `version` attribute can be used to define versions of Settings. As of right now we do not have a use for this, but it was a requested column.\r\n\r\nThe `parent_key` and `parent_value` are used to define parent Settings. This defines a relationship where child Settings are dependent on a parent Setting being turned on or off to have the option to manipulate them. This is mostly for the eventual User Interface.\r\n\r\nMajor Changes:\r\n1. Constant calls are replaced by the following format: `Setting.find_by_key(\"key\").value`. This returns the value of the Setting in the correct data_type for that Setting.\r\n2. The `settings` table is excluded from the DatabaseCleaner to allow for one-time initialization when running the test suite. This has a few implications:\r\n- Several initializers had to use `begin-rescue`s due to Settings not being initialized yet in the test suite.\r\n- Settings must be built after the DatabaseCleaner cleans the database before the suite. Because of potential concurrency issues, this needs to be done in the same `before :suite` block as the DatabaseCleaner (see `database_cleaner.rb`)\r\n- Settings should not be initialized in the tests. Rather, they should be stubbed similar to how we currently do it. See `3.` for details.\r\n3. `stub_const(\"CONST\", \"VALUE\")` is no longer suitable in the specs. Instead, use `stub_config(\"key\", value)` outside of an example block to stub a constant for all tests in that block. Note: The value needs to be passed in as the correct type. If the Setting is a boolean, value should be `true/false`. If the Setting is JSON, the value must be a valid JSON hash or array. Etc.\r\n"},"comment":{"url":"https://api.github.com/repos/sparc-request/sparc-request/issues/comments/334215905","html_url":"https://github.com/sparc-request/sparc-request/pull/1149#issuecomment-334215905","issue_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/1149","id":334215905,"user":{"login":"kyle-glick","id":12898988,"avatar_url":"https://avatars3.githubusercontent.com/u/12898988?v=4","gravatar_id":"","url":"https://api.github.com/users/kyle-glick","html_url":"https://github.com/kyle-glick","followers_url":"https://api.github.com/users/kyle-glick/followers","following_url":"https://api.github.com/users/kyle-glick/following{/other_user}","gists_url":"https://api.github.com/users/kyle-glick/gists{/gist_id}","starred_url":"https://api.github.com/users/kyle-glick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyle-glick/subscriptions","organizations_url":"https://api.github.com/users/kyle-glick/orgs","repos_url":"https://api.github.com/users/kyle-glick/repos","events_url":"https://api.github.com/users/kyle-glick/events{/privacy}","received_events_url":"https://api.github.com/users/kyle-glick/received_events","type":"User","site_admin":false},"created_at":"2017-10-04T16:39:16Z","updated_at":"2017-10-04T16:39:16Z","author_association":"COLLABORATOR","body":"Note: #1148 will conflict with this branch. When merged into `v3.0.0b`, this branch will need to be updated and `USE_EPIC` in `app/lib/epic_queue_manager.rb` will need to be replaced with `Setting.find_by_key(\"use_epic\").value`"}}
{"actor":{"display_login":"kyle-glick"}}