Skip to content

Commit

Permalink
Use a different path in the oauth scaffolder
Browse files Browse the repository at this point in the history
Joint PR with bullet-train-co/bullet_train#940

To prevent loading problems we needed to change the name of the file in
question. Deets in the PR linked above.
  • Loading branch information
jagthedrummer committed Aug 29, 2023
1 parent d2ac350 commit f154bc9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ def run
oauth_scaffold_add_line_to_file("./config/routes.rb", "resources :stripe_accounts if stripe_enabled?", "# πŸš… super scaffolding will insert new oauth providers above this line.", options, prepend: true)
oauth_scaffold_add_line_to_file("./config/routes.rb", "resources :stripe_installations if stripe_enabled?", "# πŸš… super scaffolding will insert new integration installations above this line.", options, prepend: true)
oauth_scaffold_add_line_to_file("./Gemfile", "gem 'omniauth-stripe-connect'", "# πŸš… super scaffolding will insert new oauth providers above this line.", options, prepend: true)
oauth_scaffold_add_line_to_file("./lib/bullet_train.rb", "def stripe_enabled?\n ENV['STRIPE_CLIENT_ID'].present? && ENV['STRIPE_SECRET_KEY'].present?\nend\n", "# πŸš… super scaffolding will insert new oauth providers above this line.", options, prepend: true)
oauth_scaffold_add_line_to_file("./lib/bullet_train.rb", "stripe_enabled?,", "# πŸš… super scaffolding will insert new oauth provider checks above this line.", options, prepend: true)
oauth_scaffold_add_line_to_file("./lib/bullet_train_oauth_scaffolder_support.rb", "def stripe_enabled?\n ENV['STRIPE_CLIENT_ID'].present? && ENV['STRIPE_SECRET_KEY'].present?\nend\n", "# πŸš… super scaffolding will insert new oauth providers above this line.", options, prepend: true)
oauth_scaffold_add_line_to_file("./lib/bullet_train_oauth_scaffolder_support.rb", "stripe_enabled?,", "# πŸš… super scaffolding will insert new oauth provider checks above this line.", options, prepend: true)
oauth_scaffold_add_line_to_file("./app/models/ability.rb", "if stripe_enabled?\n can [:read, :create, :destroy], Oauth::StripeAccount, user_id: user.id\n can :manage, Integrations::StripeInstallation, team_id: user.team_ids\n can :destroy, Integrations::StripeInstallation, oauth_stripe_account: {user_id: user.id}\n end\n", "# πŸš… super scaffolding will insert any new oauth providers above.", options, prepend: true)

# find the database migration that defines this relationship.
Expand Down

0 comments on commit f154bc9

Please sign in to comment.