potassium 6.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +41 -45
  4. data/lib/potassium/assets/.eslintrc.json +13 -4
  5. data/lib/potassium/assets/.github/pull_request_template.md +9 -0
  6. data/lib/potassium/assets/README.yml +6 -0
  7. data/lib/potassium/assets/app/graphql/graphql_controller.rb +55 -0
  8. data/lib/potassium/assets/app/graphql/mutations/login_mutation.rb +23 -0
  9. data/lib/potassium/assets/app/graphql/queries/base_query.rb +4 -0
  10. data/lib/potassium/assets/app/graphql/types/base/base_argument.rb +4 -0
  11. data/lib/potassium/assets/app/graphql/types/base/base_enum.rb +4 -0
  12. data/lib/potassium/assets/app/graphql/types/base/base_field.rb +5 -0
  13. data/lib/potassium/assets/app/graphql/types/base/base_input_object.rb +5 -0
  14. data/lib/potassium/assets/app/graphql/types/base/base_interface.rb +7 -0
  15. data/lib/potassium/assets/app/graphql/types/base/base_object.rb +5 -0
  16. data/lib/potassium/assets/app/graphql/types/base/base_scalar.rb +4 -0
  17. data/lib/potassium/assets/app/graphql/types/base/base_union.rb +4 -0
  18. data/lib/potassium/assets/app/graphql/types/mutation_type.rb +10 -0
  19. data/lib/potassium/assets/app/graphql/types/query_type.rb +13 -0
  20. data/lib/potassium/assets/app/uploaders/base_uploader.rb +1 -3
  21. data/lib/potassium/assets/config/graphql_playground.rb +20 -0
  22. data/lib/potassium/assets/config/puma.rb +1 -1
  23. data/lib/potassium/assets/config/shrine.rb +4 -1
  24. data/lib/potassium/assets/redis.yml +1 -2
  25. data/lib/potassium/assets/testing/rails_helper.rb +2 -0
  26. data/lib/potassium/cli/commands/create.rb +11 -19
  27. data/lib/potassium/cli_options.rb +59 -7
  28. data/lib/potassium/newest_version_ensurer.rb +19 -36
  29. data/lib/potassium/node_version_ensurer.rb +30 -0
  30. data/lib/potassium/recipes/api.rb +91 -27
  31. data/lib/potassium/recipes/background_processor.rb +34 -1
  32. data/lib/potassium/recipes/database.rb +4 -0
  33. data/lib/potassium/recipes/draper.rb +0 -9
  34. data/lib/potassium/recipes/file_storage.rb +1 -0
  35. data/lib/potassium/recipes/front_end.rb +62 -0
  36. data/lib/potassium/recipes/github.rb +93 -15
  37. data/lib/potassium/version.rb +1 -1
  38. data/potassium.gemspec +2 -1
  39. data/spec/features/api_spec.rb +25 -0
  40. data/spec/features/background_processor_spec.rb +12 -1
  41. data/spec/features/draper_spec.rb +1 -6
  42. data/spec/features/file_storage_spec.rb +5 -0
  43. data/spec/features/front_end_spec.rb +14 -0
  44. data/spec/features/github_spec.rb +53 -8
  45. data/spec/features/graphql_spec.rb +71 -0
  46. data/spec/spec_helper.rb +1 -0
  47. data/spec/support/fake_octokit.rb +31 -0
  48. metadata +40 -8
  49. data/lib/potassium/assets/api/api_error_concern.rb +0 -32
  50. data/lib/potassium/assets/api/base_controller.rb +0 -7
  51. data/lib/potassium/assets/api/draper_responder.rb +0 -62
  52. data/lib/potassium/assets/api/responder.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0542ddf33e06d797cf282c823b87d5a418280c5b31b16f4f42b9b5b54499f474
4
- data.tar.gz: 265838f7ff77f19b6ffdd0c2ecdefd3d6c33ebde2c68ec210a167b403cb70b26
3
+ metadata.gz: f0a1ede8a865324db5e181ed3cfbf3c9e1f96484caadc5c029b6c5175efc7e6b
4
+ data.tar.gz: 8639acb5ea81cfdc85d98d14db0a01be36eaca1af890091784e04b29f6680a9f
5
5
  SHA512:
6
- metadata.gz: 94b505b8058415e3b2dbcfd7161ebdb1bc9e212bd19510004212cda9ea7cddd7eb25de0b6716a628bc66614177a12b41ce866c121212d1b106b3948084e05b30
7
- data.tar.gz: f41bfc6224f310f21ba12f9949c358333158343e1dd20665980e9cb3f6132436486f30b2ffc49500acf2c6566db7d46a9906291303583d3bec6ff2fcfc9d7ed4
6
+ metadata.gz: 239fc6414dc246862c5cfedfa12a5a182e11b79897b8309e7d0f12c0cb500ef06e919b5dadf6c2f78eaf30f53de14eef923ba2992ee23f6765b055dd667d9136
7
+ data.tar.gz: 4d25beae0b7803c49cda4d35c573922c310f9a48003044fece122a87b020c75cbfc89efd8b4861bac90d7a8a8ff42496322155e1ead2c9b6214d49700e0eb994
@@ -2,6 +2,25 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 6.1.0
6
+
7
+ Features:
8
+ - Check node version before project creation [#305](https://github.com/platanus/potassium/pull/305)
9
+ - Disable observers in test environment [#319](https://github.com/platanus/potassium/pull/319)
10
+ - Allow user to select custom Github repository [#318](https://github.com/platanus/potassium/pull/318)
11
+ - Add pull request template to github enabled projects [#320](https://github.com/platanus/potassium/pull/320)
12
+ - Use a Ruby gem instead of hub to create Github repositories [#323](https://github.com/platanus/potassium/pull/323)
13
+ - Add dockerized redis configuration when using background processor [#329](https://github.com/platanus/potassium/pull/329)
14
+ - Add beta support for GraphQL. [#330](https://github.com/platanus/potassium/pull/330)
15
+ - Add power_api [#301](https://github.com/platanus/potassium/pull/301)
16
+
17
+
18
+ Fix:
19
+ - Fix shrine issues related to configuration and uploader validation [#302](https://github.com/platanus/potassium/pull/302)
20
+ - Fix database recipe not running recommended generator for strong_migrations gem [#310](https://github.com/platanus/potassium/pull/310)
21
+ - Fix puma config that was causing it to crash on server start while on development [#313](https://github.com/platanus/potassium/pull/313)
22
+ - Fix purge css being enabled in development [#327](https://github.com/platanus/potassium/pull/327)
23
+
5
24
  ## 6.0.0
6
25
 
7
26
  Features:
data/README.md CHANGED
@@ -16,7 +16,10 @@ Use the `potassium create` command to create a new project:
16
16
 
17
17
  $ potassium create <project-name>
18
18
 
19
- > It's important to note that it will perform a version check before running to ensure that you're using the latest potassium. Also, if you feel that it's too slow, you may need to update rubygems: `gem update --system`.
19
+ > Please note:
20
+ > 1. Potassium will perform a version check before running to ensure that you are using the latest potassium.
21
+ > 2. If you feel that it's too slow, you may need to update rubygems: `gem update --system`.
22
+ > 3. Potassium uses node under the hood, so a check will also be performed to ensure you are running the supported version.
20
23
 
21
24
  ### Adding recipes to an existing project
22
25
 
@@ -36,41 +39,40 @@ You can run the command on its own to view all the available recipes and select
36
39
 
37
40
  Potassium Rails apps includes the following gems and technologies:
38
41
 
39
- - [Ruby](https://www.ruby-lang.org) Set the project ruby version based on http://ruby.platan.us/latest
40
- - [dotenv](https://github.com/bkeepers/dotenv) load environmental variables in development
41
- - [Yarn](https://yarnpkg.com) for frontend assets packages.
42
- - [EditorConfig](http://editorconfig.org) for keeping all our editor configurations the same.
43
- - [pry](http://pryrepl.org) and [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) for a less painful debugging experience.
44
- - [RSpec](http://rspec.info) for unit and integration testing.
45
- - [FactoryBot](https://github.com/thoughtbot/factory_bot) for test factories.
46
- - [Guard](http://guardgem.org) for continuous testing and other watch-related tasks.
47
- - [AWS-SDK](https://github.com/aws/aws-sdk-ruby) for file uploads, sdks, etc and because we use AWS.
42
+ - [dotenv](https://github.com/bkeepers/dotenv) for loading environmental variables in development
43
+ - [Yarn](https://yarnpkg.com) for frontend assets packages
44
+ - [EditorConfig](http://editorconfig.org) for keeping all our editor configurations the same
45
+ - [pry](http://pryrepl.org) and [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) for a less painful debugging experience
46
+ - [RSpec](http://rspec.info) for unit and integration testing
47
+ - [FactoryBot](https://github.com/thoughtbot/factory_bot) for test factories
48
+ - [Guard](http://guardgem.org) for continuous testing and other watch-related tasks
49
+ - [AWS-SDK](https://github.com/aws/aws-sdk-ruby) for file uploads, sdks, etc and because we use AWS
48
50
  - [Puma](https://github.com/puma/puma) to serve HTTP requests
49
51
  - [Rack Timeout](https://github.com/heroku/rack-timeout) to abort requests that are
50
52
  taking too long
51
- - [Tzinfo-Data](https://github.com/tzinfo/tzinfo-data) for update timezone information
52
- - [Faker](https://github.com/stympy/faker) for create development data
53
-
54
- The following optional integrations are added too:
55
-
56
- - [PostgreSQL](http://www.postgresql.org) or [MySQL](https://www.mysql.com) for the database.
57
- - [Devise](https://github.com/plataformatec/devise) for authentication.
58
- - [ActiveAdmin](http://activeadmin.info) for admin interfaces.
59
- - [ActiveAdminAddons](https://github.com/platanus/activeadmin_addons) for some help with ActiveAdmin.
60
- - [Pundit](https://github.com/elabs/pundit) for role-based authorization.
61
- - [DelayedJob](https://github.com/collectiveidea/delayed_job) to execute longer tasks in the background.]
62
- - [Sidekiq](https://github.com/mperham/sidekiq) a simple, efficient background processing for Ruby.
53
+ - [Tzinfo-Data](https://github.com/tzinfo/tzinfo-data) for updating timezone information
54
+ - [Faker](https://github.com/stympy/faker) for creating development data
55
+
56
+ The following optional integrations are also added:
57
+
58
+ - [PostgreSQL](http://www.postgresql.org) or [MySQL](https://www.mysql.com) for the database
59
+ - [Devise](https://github.com/plataformatec/devise) for authentication
60
+ - [ActiveAdmin](http://activeadmin.info) for admin interfaces
61
+ - [ActiveAdminAddons](https://github.com/platanus/activeadmin_addons) for some help with ActiveAdmin
62
+ - [Pundit](https://github.com/elabs/pundit) for role-based authorization
63
+ - [DelayedJob](https://github.com/collectiveidea/delayed_job) to execute longer tasks in the background
64
+ - [Sidekiq](https://github.com/mperham/sidekiq) a simple, efficient background processing for Ruby
63
65
  - [Sidekiq-scheduler](https://github.com/moove-it/sidekiq-scheduler) to run scheduled processes
64
66
  - Mailing configuration for [AWS SES](https://github.com/aws/aws-sdk-rails)
65
67
  and [Sendgrid](https://github.com/platanus/send_grid_mailer) with recipient interceptor support
66
68
  - [Sentry](https://sentry.io) to monitor exceptions and errors
67
69
  - [Vue.js](https://vuejs.org) or [Angular 2](https://angular.io/) for frontend development
70
+ - Creates the Github repository of your choice for the project. A local git repository will always be created.
68
71
 
69
72
  A few more things are added to the project:
70
73
 
71
74
  - A [low database connection pool limit][pool]
72
- - Setup continuous integration in [CircleCI](circle-ci) to run tests.
73
- - Create the github repository for the project (it used `hub` under the hood)
75
+ - Setup continuous integration in [CircleCI](circle-ci) to run tests
74
76
  - A `bin/setup` script to setup things on a newly cloned project
75
77
  - A `bin/cibuild` script to run continuous integration build on CI
76
78
  - A `db:fake_data:load` rake task to load fake data for development
@@ -81,24 +83,20 @@ A few more things are added to the project:
81
83
 
82
84
  The optional API support includes:
83
85
 
84
- - [Responders](https://github.com/plataformatec/responders) for dry-ing our api controllers.
85
- - [Versionist](https://github.com/bploetz/versionist) for some flexible api versioning.
86
- - [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) for record serialization.
87
- - [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication) for stateless API authentication.
86
+ - [Responders](https://github.com/plataformatec/responders) for dry-ing our api controllers
87
+ - [Versionist](https://github.com/bploetz/versionist) for some flexible api versioning
88
+ - [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) for record serialization
89
+ - [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication) for stateless API authentication
88
90
 
89
91
  ### Heroku
90
92
 
91
93
  When you choose to deploy to heroku a few extra things are added for the project.
92
94
 
93
- - Adds the [Rails Stdout Logging][logging-gem] gem
94
- to configure the app to log to standard out,
95
- which is how [Heroku's logging][heroku-logging] works.
95
+ - Adds the [Rails Stdout Logging][logging-gem] gem to configure the app to log to standard out, which is how [Heroku's logging][heroku-logging] works
96
96
  - Adds a [Procfile][procfile] to define the processes to run in heroku
97
- - Setup continuous integration using docker and herokuish to maintain better
98
- parity between testing and production environments
99
- - Adds a `.buildpacks` file with the default buildpacks to use. It use the
100
- following buildpacks:
101
- - Adds a `bin/release` file with the release phase script to run specific tasks before the app is deployed completely, for example `rails db:migrate:with_data`.
97
+ - Setup continuous integration using docker and herokuish to maintain better parity between testing and production environments
98
+ - Adds a `bin/release` file with the release phase script to run specific tasks before the app is deployed completely, for example `rails db:migrate:with_data`
99
+ - Adds a `.buildpacks` file with the default buildpacks to use. It use the following buildpacks:
102
100
 
103
101
  | index | buildpack | description |
104
102
  |-------|-----------|-------------|
@@ -110,7 +108,7 @@ Also the heroku applications are created
110
108
 
111
109
  - Creates a `staging` and `production` applications
112
110
  - Creates a pipeline and assign the above application to the `staging`
113
- and `production` stages.
111
+ and `production` stages
114
112
  - Setup initial configuration variables
115
113
  - Set the application buildpack to the [multi-buildpack][heroku-buildpack-multi]
116
114
 
@@ -126,11 +124,9 @@ In order to CicleCI start building the project on each push you need tell circle
126
124
  Go to https://circleci.com/add-projects, choose the repository from the list and hit
127
125
  **Build Project**
128
126
 
129
- ### Hound CI
127
+ #### ReviewDog
130
128
 
131
- In order to Hound start checking your project's PRs you need enable that repository.
132
- Go to https://monkeyci.platan.us, choose the repository from the list and hit
133
- **Activate**
129
+ In order to enable code linting via CircleCI and ReviewDog, you need to activate the **Only build pull requests** option under the `Advanced settings` section for your project.
134
130
 
135
131
  [logging-gem]: https://github.com/heroku/rails_stdout_logging
136
132
  [heroku-logging]: https://devcenter.heroku.com/articles/logging#writing-to-your-log
@@ -149,13 +145,13 @@ This is useful when you are adding new recipes to Potassium, and you want to use
149
145
  To achieve this you need to run, **In the Potassium's root path**, the `bin/potassium_test create` instead of `potassium create` command.
150
146
  This command, will do the same as `potassium create` but first:
151
147
 
152
- - Will drop any existent database of the test app.
153
- - Will remove the directory containing a previous version of the test app.
148
+ - Will drop any existent database of the test app
149
+ - Will remove the directory containing a previous version of the test app
154
150
 
155
151
  It's important to remember that `bin/potassium_test create`:
156
152
 
157
153
  - Does not receive an `app_path` param. It always creates the test project inside `/tmp/dummy_app`
158
- - Can receive the same options as `potassium create`.
154
+ - Can receive the same options as `potassium create`
159
155
  - Runs with options with a default value. This is to avoid the "asking part" of the creation process. You need to enable what you want to test like this: `$ bin/potassium_test create --clockwork`
160
156
 
161
157
  ## Contributing
@@ -173,4 +169,4 @@ potassium is maintained by [platanus](http://platan.us).
173
169
 
174
170
  ## License
175
171
 
176
- Potassium is © 2014 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
172
+ Potassium is © 2014 Platanus, SPA. It is free software and may be redistributed under the terms specified in the LICENSE file.
@@ -22,7 +22,7 @@
22
22
  "array-callback-return": 2,
23
23
  "block-scoped-var": 2,
24
24
  "complexity": [1, {
25
- "max": 20
25
+ "max": 6
26
26
  }],
27
27
  "consistent-return": 2,
28
28
  "curly": [2, "multi-line"],
@@ -100,8 +100,8 @@
100
100
  "yoda": 2,
101
101
  "comma-dangle": [2, "always-multiline"],
102
102
  "no-cond-assign": [2, "always"],
103
- "no-console": 0,
104
- "no-debugger": 0,
103
+ "no-console": 1,
104
+ "no-debugger": 1,
105
105
  "no-constant-condition": 2,
106
106
  "no-control-regex": 2,
107
107
  "no-dupe-args": 2,
@@ -339,5 +339,14 @@
339
339
  "code": 120,
340
340
  "ignoreHTMLAttributeValues": true
341
341
  }]
342
- }
342
+ },
343
+ "overrides": [
344
+ {
345
+ "files": ["**/*.js"],
346
+ "excludedFiles": "app/**/*.js",
347
+ "env": {
348
+ "node": true
349
+ }
350
+ }
351
+ ]
343
352
  }
@@ -0,0 +1,9 @@
1
+ ### Contexto
2
+
3
+ ### Qué se esta haciendo
4
+
5
+ #### En particular hay que revisar
6
+
7
+
8
+ -----------
9
+ #### Info Adicional (pantallazos, links, fuentes, etc.)
@@ -130,6 +130,12 @@ readme:
130
130
  power_types:
131
131
  title: "Rails pattern enforcing types"
132
132
  body: "This projects uses [Power-Types](https://github.com/platanus/power-types) to generate Services, Commands, Utils and Values."
133
+ power_api:
134
+ title: "API Support"
135
+ body: "This projects uses [Power API](https://github.com/platanus/power_api). It's a Rails engine that gathers a set of gems and configurations designed to build incredible REST APIs."
136
+ graphql:
137
+ title: "API Support"
138
+ body: "This projects uses [graphql-ruby](https://graphql-ruby.org/) to generate a GraphQL API."
133
139
  active_admin:
134
140
  title: "Administration"
135
141
  body: |
@@ -0,0 +1,55 @@
1
+ class GraphqlController < ApplicationController
2
+ # If accessing from outside this domain, nullify the session
3
+ # This allows for outside API access while preventing CSRF attacks,
4
+ # but you'll have to authenticate your user separately
5
+ # protect_from_forgery with: :null_session
6
+
7
+ def execute
8
+ variables = prepare_variables(params[:variables])
9
+ query = params[:query]
10
+ operation_name = params[:operationName]
11
+ context = { current_user: get_current_user }
12
+ result = GqlSampleSchema.execute(query, variables: variables, context: context, operation_name: operation_name)
13
+ render json: result
14
+ rescue => e
15
+ raise e unless Rails.env.development?
16
+ handle_error_in_development e
17
+ end
18
+
19
+ private
20
+
21
+ # Handle variables in form data, JSON body, or a blank value
22
+ def prepare_variables(variables_param)
23
+ case variables_param
24
+ when String
25
+ if variables_param.present?
26
+ JSON.parse(variables_param) || {}
27
+ else
28
+ {}
29
+ end
30
+ when Hash
31
+ variables_param
32
+ when ActionController::Parameters
33
+ variables_param.to_unsafe_hash # GraphQL-Ruby will validate name and type of incoming variables.
34
+ when nil
35
+ {}
36
+ else
37
+ raise ArgumentError, "Unexpected parameter: #{variables_param}"
38
+ end
39
+ end
40
+
41
+ def handle_error_in_development(e)
42
+ logger.error e.message
43
+ logger.error e.backtrace.join("\n")
44
+
45
+ render json: { errors: [{ message: e.message, backtrace: e.backtrace }], data: {} }, status: 500
46
+ end
47
+
48
+ def get_current_user
49
+ if request.headers['Authorization']
50
+ _, token = request.headers['Authorization'].split
51
+ decoded_token = JWT.decode token, ENV['HMAC_SECRET'], true, { algorithm: 'HS256' }
52
+ User.find(decoded_token.first["id"])
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,23 @@
1
+ require 'jwt'
2
+
3
+ class Mutations::LoginMutation < Mutations::BaseMutation
4
+ null true
5
+
6
+ argument :email, String, required: true
7
+ argument :password, String, required: true
8
+
9
+
10
+ field :token, String, null: true
11
+
12
+ def resolve(email:, password:)
13
+ user = User.find_by(email: email)
14
+ if user&.valid_password?(password)
15
+ payload = { id: user.id, email: user.email, exp: (Time.zone.now + 24.hours).to_i }
16
+ token = JWT.encode payload, ENV['HMAC_SECRET'], 'HS256'
17
+ return { token: token }
18
+ end
19
+ GraphQL::ExecutionError.new("User or Password invalid")
20
+ rescue ActiveRecord::RecordInvalid => e
21
+ GraphQL::ExecutionError.new("Invalid input: #{e.record.errors.full_messages.join(', ')}")
22
+ end
23
+ end
@@ -0,0 +1,4 @@
1
+ module Queries
2
+ class BaseQuery < GraphQL::Schema::Resolver
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Types::Base
2
+ class BaseArgument < GraphQL::Schema::Argument
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Types::Base
2
+ class BaseEnum < GraphQL::Schema::Enum
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Types::Base
2
+ class BaseField < GraphQL::Schema::Field
3
+ argument_class Types::Base::BaseArgument
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Types::Base
2
+ class BaseInputObject < GraphQL::Schema::InputObject
3
+ argument_class Types::Base::BaseArgument
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module Types::Base
2
+ module BaseInterface
3
+ include GraphQL::Schema::Interface
4
+
5
+ field_class Types::Base::BaseField
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module Types::Base
2
+ class BaseObject < GraphQL::Schema::Object
3
+ field_class Types::Base::BaseField
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module Types::Base
2
+ class BaseScalar < GraphQL::Schema::Scalar
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Types::Base
2
+ class BaseUnion < GraphQL::Schema::Union
3
+ end
4
+ end
@@ -0,0 +1,10 @@
1
+ module Types
2
+ class MutationType < Types::Base::BaseObject
3
+ # TODO: remove me
4
+ field :test_field, String, null: false,
5
+ description: "An example field added by the generator"
6
+ def test_field
7
+ "Hello World"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ module Types
2
+ class QueryType < Types::Base::BaseObject
3
+ # Add root-level fields here.
4
+ # They will be entry points for queries on your schema.
5
+
6
+ # TODO: remove me
7
+ field :test_field, String, null: false,
8
+ description: "An example field added by the generator"
9
+ def test_field
10
+ "Hello World!"
11
+ end
12
+ end
13
+ end
@@ -2,11 +2,9 @@ class BaseUploader < Shrine
2
2
  plugin :validation_helpers
3
3
 
4
4
  Attacher.validate do
5
- validate_mime_type allowed_types
5
+ validate_mime_type store.allowed_types
6
6
  end
7
7
 
8
- private
9
-
10
8
  def allowed_types
11
9
  raise NotImplementedError
12
10
  end
@@ -0,0 +1,20 @@
1
+ # config/initializers/graphql_playground.rb
2
+ # All config options have a default that should work out of the box
3
+ if Rails.env.development?
4
+ GraphqlPlayground::Rails.configure do |config|
5
+ # config.headers = {
6
+ # 'X-Auth-Header' => ->(view_context) { "123" }
7
+ # }
8
+ # config.title = "Playground"
9
+ # config.csrf = true
10
+ # config.playground_version = "latest"
11
+ # # Ideally the assets would be added to your projects `vendor/assets` directories
12
+ # config.favicon = "/assets/playground.ico"
13
+ # config.playground_js_url = "/assets/playground.js"
14
+ # config.playground_css_url = "/assets/playground.css"
15
+ # # see: https://github.com/prisma-labs/graphql-playground#settings
16
+ config.settings = {
17
+ "schema.polling.enable": false
18
+ }
19
+ end
20
+ end