exvo_notifications 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,14 +5,22 @@ module ExvoNotifications
5
5
 
6
6
  def create
7
7
  user = User.find_or_create_by_uid(params[:user_uid])
8
- user.update_attributes(:plan => params[:edition_title])
9
- render :json => { :status => 200 }
8
+ user.plan = params[:edition_title]
9
+ if user.save
10
+ render :json => "Successfully created", :status => 201
11
+ else
12
+ render :json => user.errors, :status => :unprocessable_entity
13
+ end
10
14
  end
11
15
 
12
16
  def destroy
13
17
  user = User.find_or_create_by_uid(params[:user_uid])
14
- user.update_attributes(:plan => nil)
15
- render :json => { :status => 200 }
18
+ user.plan = nil
19
+ if user.save
20
+ render :json => "Successfully removed", :status => 200
21
+ else
22
+ render :json => user.errors, :status => :unprocessable_entity
23
+ end
16
24
  end
17
25
 
18
26
  end
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 6
10
- version: 0.2.6
9
+ - 7
10
+ version: 0.2.7
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-21 00:00:00 +02:00
18
+ date: 2010-10-26 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21