exvo_notifications 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,10 +15,14 @@ module ExvoNotifications::Controllers::Access
15
15
  begin
16
16
  consumer = ExvoAuth::Autonomous::Consumer.new(:provider_id => ENV['EXVO_STORE_CLIENT_ID'])
17
17
  response = consumer.get("/editions", { :query => { :user_uid => current_user.uid } } )
18
- if response.parsed_response["edition"] == false
19
- redirect_to response.parsed_response["url"]
18
+ if response.code == 200
19
+ if response.parsed_response["edition"] == false
20
+ redirect_to response.parsed_response["url"]
21
+ else
22
+ current_user.update_attributes(:plan => response.parsed_response["edition"])
23
+ end
20
24
  else
21
- current_user.update_attributes(:plan => response.parsed_response["edition"])
25
+ raise "unknown status"
22
26
  end
23
27
  rescue
24
28
  render :file => 'public/not_working.html', :layout => false
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exvo_notifications
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Robert S\xC4\x99k"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-14 00:00:00 +02:00
18
+ date: 2010-10-15 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21