rao-api-service_controller 0.0.48.pre → 0.0.50.pre
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74649d98f935a7e11579d9887f5336b5c556014a76100b0509940ac55c53788c
|
4
|
+
data.tar.gz: c397cee0abeb568f7ac11f72f476e59dc2758b266fe7c35f31760216fe72e23a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a71176d64a03efacd13db1e034a1bcb561375a5fd970514d9a0bfb81581f5b298ca3d82f6cefaac589044c8528b269e0481288584c3c82a7259095a265fb146
|
7
|
+
data.tar.gz: 0c6dec929476ca1293bf4ce88958df08b37d0fc1ab81332e1c573a8c82e735fd33b3a68bc2bad36eeec40c75051e21b866af27cc0dd2b6124b5a0754b2e94c24
|
data/README.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# Rao::Api:ServiceController
|
2
|
+
|
2
3
|
Short description and motivation.
|
3
4
|
|
4
5
|
## Usage
|
6
|
+
|
5
7
|
How to use my plugin.
|
6
8
|
|
7
9
|
## Installation
|
10
|
+
|
8
11
|
Add this line to your application's Gemfile:
|
9
12
|
|
10
13
|
```ruby
|
@@ -12,11 +15,13 @@ gem 'rao-api-service_controller'
|
|
12
15
|
```
|
13
16
|
|
14
17
|
And then execute:
|
18
|
+
|
15
19
|
```bash
|
16
20
|
$ bundle
|
17
21
|
```
|
18
22
|
|
19
23
|
Or install it yourself as:
|
24
|
+
|
20
25
|
```bash
|
21
26
|
$ gem install rao-api-service_controller
|
22
27
|
```
|
@@ -27,8 +32,30 @@ Generate the initializer:
|
|
27
32
|
$ rails g rao:api:service_controller:install
|
28
33
|
```
|
29
34
|
|
35
|
+
## Customizing the initialization of the service
|
36
|
+
|
37
|
+
The service is initialized in the initialize_service_for_create method before
|
38
|
+
it is called/performed.
|
39
|
+
|
40
|
+
If you want to do things with the service before it gets called you can override
|
41
|
+
this method in you controller:
|
42
|
+
|
43
|
+
# app/controller/import_services_controller.rb
|
44
|
+
class ImportServicesController < ApplicationServicesController
|
45
|
+
#...
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def initialize_service_for_create
|
50
|
+
super
|
51
|
+
@service.current_user_id = session['current_user_id']
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
30
55
|
## Contributing
|
56
|
+
|
31
57
|
Contribution directions go here.
|
32
58
|
|
33
59
|
## License
|
60
|
+
|
34
61
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -58,8 +58,9 @@ module Rao
|
|
58
58
|
#
|
59
59
|
# Example:
|
60
60
|
# # app/controller/import_services_controller.rb
|
61
|
-
# class
|
61
|
+
# class ImportServicesController < ApplicationServicesController
|
62
62
|
# #...
|
63
|
+
#
|
63
64
|
# private
|
64
65
|
#
|
65
66
|
# def initialize_service_for_create
|
@@ -80,6 +81,10 @@ module Rao
|
|
80
81
|
{ autosave: true }
|
81
82
|
end
|
82
83
|
|
84
|
+
def params
|
85
|
+
super.deep_transform_keys!(&:underscore)
|
86
|
+
end
|
87
|
+
|
83
88
|
def permitted_params
|
84
89
|
raise "You have to implement permitted_params in #{self.class.name}."
|
85
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rao-api-service_controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.50.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: 1.3.1
|
140
140
|
requirements: []
|
141
|
-
rubygems_version: 3.
|
141
|
+
rubygems_version: 3.4.20
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: API Services Controller for Ruby on Rails.
|