Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
Fix small issue with signing in to googledrive session and accessing …
Browse files Browse the repository at this point in the history
…spreadsheet
  • Loading branch information
simaob committed Feb 7, 2017
1 parent f3e237e commit fa1fb77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/api/v1/sign_up_updates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class SignUpUpdatesController < BaseControllerV1
def create
# https://github.com/gimite/google-drive-ruby/blob/master/doc/authorization.md
config = File.read(File.join(Rails.root, 'config', 'gdrive.json.erb'))
config = JSON.parse(ERB.new(config).result(binding))
session = GoogleDrive::Session.from_service_account_key(config)
config = ERB.new(config).result(binding)
session = GoogleDrive::Session.from_service_account_key(StringIO.new(config))

sheet = session.spreadsheet_by_key(ENV["DRIVE_PRIVATE_KEY_ID"]).worksheets[0]
sheet = session.spreadsheet_by_key(ENV["SPREADSHEETS_ID"]).worksheets[0]

response = {}
if already_added(sheet)
Expand Down

0 comments on commit fa1fb77

Please sign in to comment.