Skip to content

Commit

Permalink
To get seeds to work, moved created plans before creating admin users…
Browse files Browse the repository at this point in the history
…; hardcoded stripe API keys into secrets.yml to work with my development environment, see: RailsApps/rails-stripe-membership-saas#152
  • Loading branch information
rskelley9 committed Oct 14, 2015
1 parent 3f5de67 commit 681d933
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,3 @@ DEPENDENCIES
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)

BUNDLED WITH
1.10.5
18 changes: 10 additions & 8 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ development:
domain_name: example.com
mailchimp_api_key: <%= ENV["MAILCHIMP_API_KEY"] %>
mailchimp_list_id: <%= ENV["MAILCHIMP_LIST_ID"] %>
stripe_api_key: <%= ENV["STRIPE_API_KEY"] %>
stripe_publishable_key: <%= ENV["STRIPE_PUBLISHABLE_KEY"] %>
# stripe_api_key: <%= ENV["STRIPE_API_KEY"] %>
stripe_api_key: sk_test_B5RUJ3ZgW7BnB5VKp1vNbE7e
# stripe_publishable_key: <%= ENV["STRIPE_PUBLISHABLE_KEY"] %>
stripe_publishable_key: pk_test_w5BDNvBFAjPzc5qJJRusg93V;
secret_key_base: 36bff586540ed0a35d14e005d041fe05c12ff1be0c5a9238cdec06a7f6f11f6c4d456e6e5376bff6f2ed0492799a3ee2b4c051d09b76a7848e076ed1339c6d4e

test:
domain_name: example.com
domain_name: example.com
secret_key_base: 97e8aa9bcf966bd1ede882fbb6fd18e6de4667a26576ca89a6a46301cfedb9ef244b52811c3c6ba1464cab24eb99ca3327ab90fb1f83cb68b692e6b3effb95be

# Do not keep production secrets in the repository,
Expand All @@ -34,10 +36,10 @@ production:
admin_email: <%= ENV["ADMIN_EMAIL"] %>
admin_password: <%= ENV["ADMIN_PASSWORD"] %>
email_provider_username: <%= ENV["SENDGRID_USERNAME"] %>
email_provider_password: <%= ENV["SENDGRID_PASSWORD"] %>
email_provider_password: <%= ENV["SENDGRID_PASSWORD"] %>
domain_name: <%= ENV["DOMAIN_NAME"] %>
mailchimp_api_key: <%= ENV["MAILCHIMP_API_KEY"] %>
mailchimp_list_id: <%= ENV["MAILCHIMP_LIST_ID"] %>
stripe_api_key: <%= ENV["STRIPE_API_KEY"] %>
stripe_publishable_key: <%= ENV["STRIPE_PUBLISHABLE_KEY"] %>
mailchimp_api_key: <%= ENV["MAILCHIMP_API_KEY"] %>
mailchimp_list_id: <%= ENV["MAILCHIMP_LIST_ID"] %>
stripe_api_key: <%= ENV["STRIPE_API_KEY"] %>
stripe_publishable_key: <%= ENV["STRIPE_PUBLISHABLE_KEY"] %>
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
4 changes: 2 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)

user = CreateAdminService.new.call
puts 'CREATED ADMIN USER: ' << user.email
CreatePlanService.new.call
puts 'CREATED PLANS'
user = CreateAdminService.new.call
puts 'CREATED ADMIN USER: ' << user.email
CreateCharityService.new.call
puts 'CREATED CHARITIES'

Expand Down

0 comments on commit 681d933

Please sign in to comment.