nps_surveys 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e2e2fcac122892bc7f86fcbdaca1b277dbfe04c
4
- data.tar.gz: 18093e363ec7a95c8e34c16e710fec2a34f95c9d
3
+ metadata.gz: aa05de9f710b4e73303345f68d43d0b633fc8dc5
4
+ data.tar.gz: 36f14835b067991aa7a859b3f8104d47561b691c
5
5
  SHA512:
6
- metadata.gz: 235d91f2cd04c163ffd32bd5aa901668c3a338e9b6e4a226b90ec4f50283d0da221aec69963e51e2bda3f5ad9f1de2c3730776bd0e4dcc8140bccfda9bac49ef
7
- data.tar.gz: 5879a443a88c9a784a645ebf9cf9f6b65099e285deaa860685798a87d2ca8dcb553d5d6dc87c89fd1640732d30a5aaa5e90016f09f4aa2ccfd805a067ff8562d
6
+ metadata.gz: a40595a9727acbc79a23ec609494f4898db601caf7531a4d910e05bcff8fff72c4a67a02cd7ec39e7b1d026e46b3966d9fe65b2c98fec3e519c1e92ef6633d73
7
+ data.tar.gz: 411b5cb2e80ec254df8072685d71e7f94e1ca05cc045d623a49b0ef4ad0234eba571caf2ad2f2085eba4e63ad8faacd6b104749ba06e28607771b39d9b560bfc
@@ -15,7 +15,7 @@ module NPSSurveys
15
15
  end
16
16
 
17
17
  def index
18
- responses = ::NPSSurveys::Response.where(user_id: NPSSurveys.current_user.call.id).map do |response|
18
+ responses = ::NPSSurveys::Response.where(user_id: NPSSurveys.current_user.call(self).id).map do |response|
19
19
  ResponseSerializer.new(response).to_json
20
20
  end
21
21
 
@@ -26,9 +26,9 @@ module NPSSurveys
26
26
 
27
27
  def create_survey_response
28
28
  response = ::NPSSurveys::Response.new
29
- response.user_id = NPSSurveys.current_user.call.id
30
- response.score = params[:score],
31
- response.feedback = params[:feedback],
29
+ response.user_id = NPSSurveys.current_user.call(self).id
30
+ response.score = params[:score].to_i
31
+ response.feedback = params[:feedback]
32
32
  response.survey = params[:survey]
33
33
  response.save
34
34
  response
@@ -2,4 +2,8 @@ NPSSurveys.controller_parent_class = ::ApplicationController
2
2
  NPSSurveys.route_namespace = :api_internal
3
3
  NPSSurveys.route_path = 'api/internal'
4
4
  NPSSurveys.route_scope = 'nps_surveys'
5
- NPSSurveys.current_user = lambda { self.current_user }
5
+ NPSSurveys.current_user = lambda { |controller| controller.send(:current_user) }
6
+
7
+ ActiveSupport::Inflector.inflections do |inflect|
8
+ inflect.acronym 'NPS'
9
+ end
@@ -1,3 +1,3 @@
1
1
  module NPSSurveys
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
@@ -0,0 +1 @@
1
+ Connecting to database specified by database.yml
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nps_surveys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Redbooth team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-04 00:00:00.000000000 Z
11
+ date: 2016-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -118,7 +118,7 @@ files:
118
118
  - app/controllers/nps_surveys/api_internal/responses_controller.rb
119
119
  - app/exceptions/app_exception/unprocessable_entity.rb~
120
120
  - app/models/nps_surveys/response.rb
121
- - app/serializers/nps_surveys/response_presenter.rb
121
+ - app/serializers/nps_surveys/response_serializer.rb
122
122
  - config/initializers/defaults.rb
123
123
  - config/initializers/mount_routes.rb
124
124
  - config/routes.rb
@@ -156,6 +156,7 @@ files:
156
156
  - spec/dummy/db/migrate/20160721092137_create_users.rb
157
157
  - spec/dummy/db/migrate/20160721092137_create_users.rb~
158
158
  - spec/dummy/db/schema.rb
159
+ - spec/dummy/log/development.log
159
160
  - spec/dummy/log/test.log
160
161
  - spec/dummy/public/404.html
161
162
  - spec/dummy/public/422.html
@@ -213,6 +214,7 @@ test_files:
213
214
  - spec/dummy/db/migrate/20160721092137_create_users.rb
214
215
  - spec/dummy/db/migrate/20160721092137_create_users.rb~
215
216
  - spec/dummy/db/schema.rb
217
+ - spec/dummy/log/development.log
216
218
  - spec/dummy/log/test.log
217
219
  - spec/dummy/Rakefile
218
220
  - spec/dummy/public/500.html