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 +4 -4
- data/app/controllers/nps_surveys/api_internal/responses_controller.rb +4 -4
- data/app/serializers/nps_surveys/{response_presenter.rb → response_serializer.rb} +0 -0
- data/config/initializers/defaults.rb +5 -1
- data/lib/nps_surveys/version.rb +1 -1
- data/spec/dummy/log/development.log +1 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa05de9f710b4e73303345f68d43d0b633fc8dc5
|
4
|
+
data.tar.gz: 36f14835b067991aa7a859b3f8104d47561b691c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
File without changes
|
@@ -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 {
|
5
|
+
NPSSurveys.current_user = lambda { |controller| controller.send(:current_user) }
|
6
|
+
|
7
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
8
|
+
inflect.acronym 'NPS'
|
9
|
+
end
|
data/lib/nps_surveys/version.rb
CHANGED
@@ -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.
|
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-
|
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/
|
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
|