rails_ops 1.1.21 → 1.1.25
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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +27 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +17 -0
- data/LICENSE +1 -1
- data/README.md +105 -15
- data/Rakefile +4 -0
- data/VERSION +1 -1
- data/lib/generators/operation/USAGE +21 -0
- data/lib/generators/operation/operation_generator.rb +46 -0
- data/lib/generators/operation/templates/controller.erb +39 -0
- data/lib/generators/operation/templates/create.erb +11 -0
- data/lib/generators/operation/templates/destroy.erb +9 -0
- data/lib/generators/operation/templates/load.erb +5 -0
- data/lib/generators/operation/templates/update.erb +12 -0
- data/lib/generators/operation/templates/view.erb +0 -0
- data/lib/rails_ops/mixins/model/authorization.rb +3 -1
- data/lib/rails_ops/model_mixins/sti_fixes.rb +21 -0
- data/lib/rails_ops/model_mixins.rb +1 -0
- data/lib/rails_ops/operation/model/update.rb +17 -2
- data/lib/rails_ops.rb +1 -0
- data/rails_ops.gemspec +25 -27
- data/test/dummy/app/models/animal.rb +1 -0
- data/test/dummy/app/models/bird.rb +1 -0
- data/test/dummy/app/models/cat.rb +1 -0
- data/test/dummy/app/models/dog.rb +1 -0
- data/test/dummy/app/models/flower.rb +7 -0
- data/test/dummy/app/models/nightingale.rb +1 -0
- data/test/dummy/app/models/phoenix.rb +1 -0
- data/test/dummy/app/models/user.rb +3 -0
- data/test/dummy/config/application.rb +12 -1
- data/test/dummy/config/environments/test.rb +1 -1
- data/test/dummy/config/initializers/backtrace_silencers.rb +1 -1
- data/test/dummy/db/schema.rb +8 -0
- data/test/test_helper.rb +2 -0
- data/test/unit/rails_ops/generators/operation_generator_test.rb +170 -0
- data/test/unit/rails_ops/operation/model/sti_test.rb +70 -0
- data/test/unit/rails_ops/operation/model/update_test.rb +26 -0
- data/test/unit/rails_ops/operation/update_auth_test.rb +62 -0
- data/test/unit/rails_ops/operation/update_lazy_auth_test.rb +63 -0
- metadata +99 -10
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79ec45d11348e1ffbef7fc2c25296ffd0d7aad9368aca809c4affcbfb6ca9139
|
4
|
+
data.tar.gz: c2199c588e87f2e2327711b56fd9ff27703856c9dfb0a3bc5d694715c717d6d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f330c3f01bdd16406f5a4cf9da7a8ab7aa5d39aa6a30870119f40d817a4118bf8d9050744e14794844b36a1d86a75ecdbc5f50680538f712ecb9536aab4c089
|
7
|
+
data.tar.gz: fedfdc7b9a6eb869a59d7546c39ab71cfa594530ce4e018693bf898e90f4c4de3d7ed504200b846b4929ab11d64bdce3b0357d5b8ef06e053c1cf8477b69a679
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Build
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
fail-fast: false
|
14
|
+
matrix:
|
15
|
+
ruby-version: ['2.3.0', '2.5.1', '2.6.2', '2.7.1', '3.0.1']
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- name: Set up Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby-version }}
|
23
|
+
bundler-cache: true
|
24
|
+
- name: Run rake tests
|
25
|
+
run: bundle exec rake test
|
26
|
+
- name: Run rubocop
|
27
|
+
run: bundle exec rubocop
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.1.25 (2022-01-17)
|
4
|
+
|
5
|
+
* #24: Add generator `operation` that generates a controller, operations and empty
|
6
|
+
view files
|
7
|
+
|
8
|
+
## 1.1.24 (2021-11-24)
|
9
|
+
|
10
|
+
* Add support for STI in model operations
|
11
|
+
|
12
|
+
## 1.1.23 (2021-11-01)
|
13
|
+
|
14
|
+
* No changes to previous release
|
15
|
+
|
16
|
+
## 1.1.22 (2021-11-01)
|
17
|
+
|
18
|
+
* Add support for lazy model authorization
|
19
|
+
|
3
20
|
## 1.1.21 (2021-06-23)
|
4
21
|
|
5
22
|
* Fix using model operations in conjunction with Single Table Inheritance (STI)
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[](https://github.com/sitrox/rails_ops/actions/workflows/ruby.yml)
|
2
2
|
[](https://badge.fury.io/rb/rails_ops)
|
3
3
|
|
4
4
|
rails_ops
|
@@ -988,24 +988,18 @@ class Operations::User::Load < RailsOps::Operation::Model::Load
|
|
988
988
|
model User
|
989
989
|
end
|
990
990
|
|
991
|
-
op = Operations::User::Load.run!(id: 5)
|
992
|
-
op.model.id # => 5
|
993
|
-
```
|
994
|
-
|
995
|
-
Note that this base class is a bit of a special case: It does not provide a
|
996
|
-
`perform` method and does not need to be run at all in order to load a model.
|
997
|
-
This is very useful when, for example, displaying a form based on a model
|
998
|
-
instance without actually performing any particular action such as updating a
|
999
|
-
model.
|
1000
|
-
|
1001
|
-
Therefore, the above example would also work as follows:
|
1002
|
-
|
1003
|
-
```ruby
|
1004
991
|
# The operation does not have to be performed to access the model instance.
|
1005
992
|
op = Operations::User::Load.new(id: 5)
|
1006
993
|
op.model.id # => 5
|
1007
994
|
```
|
1008
995
|
|
996
|
+
Note that this base class is a bit of a special case: It does not provide an
|
997
|
+
implementation of the `perform` method and does not need to be run at all in
|
998
|
+
order to load a model (in fact, it cannot be run unless you override the
|
999
|
+
`perform` method). This is very useful when, for example, displaying a form
|
1000
|
+
based on a model instance without actually performing any particular action such
|
1001
|
+
as updating a model.
|
1002
|
+
|
1009
1003
|
#### Specifying ID field
|
1010
1004
|
|
1011
1005
|
Per default, the model instance is looked up using the field `id` and the ID
|
@@ -1195,6 +1189,25 @@ end
|
|
1195
1189
|
Note that using the different model base classes, this is already set to a
|
1196
1190
|
sensible default. See the respective class' source code for details.
|
1197
1191
|
|
1192
|
+
#### Lazy model update authorization
|
1193
|
+
|
1194
|
+
In case of operations inheriting from `RailsOps::Operation::Model::Update`, you
|
1195
|
+
can specify the `model_authorization_action` to be `lazy`, meaning that it will
|
1196
|
+
only be checked when *performing* the operation, but not on initialization. This
|
1197
|
+
can be useful for displaying readonly forms to users which have read-permissions
|
1198
|
+
only:
|
1199
|
+
|
1200
|
+
```ruby
|
1201
|
+
class Operations::User::Update < RailsOps::Operation::Model::Update
|
1202
|
+
model User
|
1203
|
+
|
1204
|
+
# This automatically calls `authorize_model! :read`. Because it is set to be
|
1205
|
+
# `lazy`, the authorization will only run when the operation is actually
|
1206
|
+
# *performed*, and not already at instantiation.
|
1207
|
+
model_authorization_action :update, lazy: true
|
1208
|
+
end
|
1209
|
+
```
|
1210
|
+
|
1198
1211
|
### Model nesting
|
1199
1212
|
|
1200
1213
|
Using active record, multiple nested models can be saved at once by using
|
@@ -1257,6 +1270,34 @@ This block receives the params hash as it would be passed to the sub operation
|
|
1257
1270
|
and allows to modify it. The block's return value is then passed to the
|
1258
1271
|
sub-operation. Do not change the params inplace but instead return a new hash.
|
1259
1272
|
|
1273
|
+
### Single-table inheritance
|
1274
|
+
|
1275
|
+
Model operations also support STI models (Single Table Inheritance). However,
|
1276
|
+
there is the caviat that if you do extend your model in the operation (e.g.
|
1277
|
+
`model Animal do { ... }`), RailsOps automatically creates an anonymous subclass
|
1278
|
+
of the given class (e.g. `Animal`). Operations will always load / create models
|
1279
|
+
that are instances of this anonymous class.
|
1280
|
+
|
1281
|
+
Consider the following operation:
|
1282
|
+
|
1283
|
+
```ruby
|
1284
|
+
class Animal < ApplicationRecord; end
|
1285
|
+
class Bird < Animal; end
|
1286
|
+
class Mouse < Animal; end
|
1287
|
+
|
1288
|
+
class LoadAnimal < RailsOps::Operation::Model::Load
|
1289
|
+
model Animal do
|
1290
|
+
# Something
|
1291
|
+
end
|
1292
|
+
end
|
1293
|
+
|
1294
|
+
bird = Bird.create
|
1295
|
+
op_bird = LoadAnimal.new(id: bird.id)
|
1296
|
+
|
1297
|
+
bird.class # => Class "Bird", extending "Animal"
|
1298
|
+
op_bird.class # => Anonymous class, extending "Animal", not "Bird"
|
1299
|
+
```
|
1300
|
+
|
1260
1301
|
Record extension and virtual records
|
1261
1302
|
------------------------------------
|
1262
1303
|
|
@@ -1447,6 +1488,55 @@ sub-operations, see section *Calling sub-operations* for more information.
|
|
1447
1488
|
Operation Inheritance
|
1448
1489
|
---------------------
|
1449
1490
|
|
1491
|
+
Generators
|
1492
|
+
----------
|
1493
|
+
|
1494
|
+
RailsOps features a generator to easily create a structure for common CRUD-style
|
1495
|
+
constructs. The generator creates the CRUD operations, some empty view files, a
|
1496
|
+
controller and adds an entry in the routing file.
|
1497
|
+
|
1498
|
+
This is e.g. useful when adding a new model to an application, as the basic structure
|
1499
|
+
is usually rather similar.
|
1500
|
+
|
1501
|
+
### Usage
|
1502
|
+
|
1503
|
+
Run the generator using the `operation` generator, specifying the name of the
|
1504
|
+
operation class:
|
1505
|
+
|
1506
|
+
```ruby
|
1507
|
+
rails g operation User
|
1508
|
+
```
|
1509
|
+
|
1510
|
+
This will generate the following operations:
|
1511
|
+
|
1512
|
+
* `app/operations/user/load.rb`
|
1513
|
+
* `app/operations/user/create.rb`
|
1514
|
+
* `app/operations/user/update.rb`
|
1515
|
+
* `app/operations/user/destroy.rb`
|
1516
|
+
|
1517
|
+
as well as the controller `app/controllers/users_controller.rb` and the following
|
1518
|
+
empty view files:
|
1519
|
+
|
1520
|
+
* `app/views/users/index.html.haml`
|
1521
|
+
* `app/views/users/show.html.haml`
|
1522
|
+
* `app/views/users/new.html.haml`
|
1523
|
+
* `app/views/users/edit.html.haml`
|
1524
|
+
|
1525
|
+
It will also add the entry `resources :users` to the `config/routes.rb` file.
|
1526
|
+
|
1527
|
+
If you want to skip the controller, the views or the routes, you can do so using the
|
1528
|
+
flags:
|
1529
|
+
|
1530
|
+
* `--skip-controller`
|
1531
|
+
* `--skip-routes`
|
1532
|
+
* `--skip-views`
|
1533
|
+
|
1534
|
+
Or if you want to skip them all: `--only-operations`.
|
1535
|
+
|
1536
|
+
Of course, at this point, the operations will need some adaptions, especially the
|
1537
|
+
[parameter schemas](#validating-params), and the controllers need the logic for the
|
1538
|
+
success and failure cases, as this depends on your application.
|
1539
|
+
|
1450
1540
|
Caveats
|
1451
1541
|
-------
|
1452
1542
|
|
@@ -1468,4 +1558,4 @@ Rails architecture.
|
|
1468
1558
|
|
1469
1559
|
## Copyright
|
1470
1560
|
|
1471
|
-
Copyright © 2017 -
|
1561
|
+
Copyright © 2017 - 2022 Sitrox. See `LICENSE` for further details.
|
data/Rakefile
CHANGED
@@ -18,7 +18,11 @@ task :gemspec do
|
|
18
18
|
spec.add_development_dependency 'bundler'
|
19
19
|
spec.add_development_dependency 'rake'
|
20
20
|
spec.add_development_dependency 'sqlite3'
|
21
|
+
spec.add_development_dependency 'cancancan'
|
22
|
+
spec.add_development_dependency 'pry'
|
23
|
+
spec.add_development_dependency 'colorize'
|
21
24
|
spec.add_development_dependency 'rubocop', '0.47.1'
|
25
|
+
spec.add_development_dependency 'sprockets-rails'
|
22
26
|
spec.add_dependency 'active_type', '>= 1.3.0'
|
23
27
|
spec.add_dependency 'minitest'
|
24
28
|
spec.add_dependency 'rails'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.25
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Description:
|
2
|
+
Generates CRUD operations, along with a controller, views and an entry in the route file
|
3
|
+
|
4
|
+
Example:
|
5
|
+
bin/rails generate operation User
|
6
|
+
|
7
|
+
This will create:
|
8
|
+
app/operations/user/load.rb
|
9
|
+
app/operations/user/create.rb
|
10
|
+
app/operations/user/update.rb
|
11
|
+
app/operations/user/destroy.rb
|
12
|
+
|
13
|
+
app/controllers/users_controller.rb
|
14
|
+
|
15
|
+
app/views/users/index.html.haml
|
16
|
+
app/views/users/show.html.haml
|
17
|
+
app/views/users/new.html.haml
|
18
|
+
app/views/users/edit.html.haml
|
19
|
+
|
20
|
+
And add a routing entry:
|
21
|
+
resources :users
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class OperationGenerator < Rails::Generators::NamedBase
|
2
|
+
source_root File.expand_path('templates', __dir__)
|
3
|
+
|
4
|
+
class_option :skip_controller, type: :boolean, desc: "Don't add a controller."
|
5
|
+
class_option :skip_views, type: :boolean, desc: "Don't add the views."
|
6
|
+
class_option :skip_routes, type: :boolean, desc: "Don't add routes to config/routes.rb."
|
7
|
+
class_option :only_operations, type: :boolean, desc: 'Only add the operations. This is equal to specifying --skip-controller --skip-routes --skip-views'
|
8
|
+
|
9
|
+
def add_operations
|
10
|
+
@class_name = name.classify
|
11
|
+
@underscored_name = name.underscore
|
12
|
+
@underscored_pluralized_name = name.underscore.pluralize
|
13
|
+
|
14
|
+
operations_path = "app/operations/#{@underscored_name}"
|
15
|
+
|
16
|
+
template 'load.erb', "#{operations_path}/load.rb"
|
17
|
+
template 'create.erb', "#{operations_path}/create.rb"
|
18
|
+
template 'update.erb', "#{operations_path}/update.rb"
|
19
|
+
template 'destroy.erb', "#{operations_path}/destroy.rb"
|
20
|
+
end
|
21
|
+
|
22
|
+
def add_controller
|
23
|
+
return if options[:skip_controller] || options[:only_operations]
|
24
|
+
|
25
|
+
controller_file_path = "app/controllers/#{@underscored_pluralized_name}_controller.rb"
|
26
|
+
@controller_name = "#{@class_name.pluralize}Controller"
|
27
|
+
|
28
|
+
template 'controller.erb', controller_file_path
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_views
|
32
|
+
return if options[:skip_views] || options[:only_operations]
|
33
|
+
|
34
|
+
views_folder = "app/views/#{@underscored_pluralized_name}"
|
35
|
+
|
36
|
+
%w(index show new edit).each do |view|
|
37
|
+
template 'view.erb', "#{views_folder}/#{view}.html.haml"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_routes
|
42
|
+
return if options[:skip_routes] || options[:only_operations]
|
43
|
+
|
44
|
+
route "resources :#{@underscored_pluralized_name}"
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class <%= @controller_name %> < ApplicationController
|
2
|
+
def index; end
|
3
|
+
|
4
|
+
def show
|
5
|
+
op Operations::<%= @class_name %>::Load
|
6
|
+
end
|
7
|
+
|
8
|
+
def new
|
9
|
+
op Operations::<%= @class_name %>::Create
|
10
|
+
end
|
11
|
+
|
12
|
+
def create
|
13
|
+
if run Operations::<%= @class_name %>::Create
|
14
|
+
# handle successful case
|
15
|
+
else
|
16
|
+
# handle error case
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def edit
|
21
|
+
op Operations::<%= @class_name %>::Update
|
22
|
+
end
|
23
|
+
|
24
|
+
def update
|
25
|
+
if run Operations::<%= @class_name %>::Update
|
26
|
+
# handle successful case
|
27
|
+
else
|
28
|
+
# handle error case
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def destroy
|
33
|
+
if run Operations::<%= @class_name %>::Destroy
|
34
|
+
# handle successful case
|
35
|
+
else
|
36
|
+
# handle error case
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
File without changes
|
@@ -6,13 +6,15 @@ module RailsOps::Mixins::Model::Authorization
|
|
6
6
|
|
7
7
|
included do
|
8
8
|
class_attribute :_model_authorization_action
|
9
|
+
class_attribute :_model_authorization_lazy
|
9
10
|
end
|
10
11
|
|
11
12
|
module ClassMethods
|
12
13
|
# Gets or sets the action verb used for authorizing models.
|
13
|
-
def model_authorization_action(*action)
|
14
|
+
def model_authorization_action(*action, lazy: false)
|
14
15
|
if action.size == 1
|
15
16
|
self._model_authorization_action = action.first
|
17
|
+
self._model_authorization_lazy = lazy
|
16
18
|
elsif action.size > 1
|
17
19
|
fail ArgumentError, 'Too many arguments'
|
18
20
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module RailsOps
|
2
|
+
module ModelMixins
|
3
|
+
module StiFixes
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
class_methods do
|
7
|
+
def finder_needs_type_condition?
|
8
|
+
superclass.finder_needs_type_condition?
|
9
|
+
end
|
10
|
+
|
11
|
+
def descendants
|
12
|
+
superclass.descendants
|
13
|
+
end
|
14
|
+
|
15
|
+
def name
|
16
|
+
superclass.name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -8,5 +8,6 @@ module RailsOps::ModelMixins
|
|
8
8
|
include VirtualAttributes # Provides virtual attributes functionality.
|
9
9
|
include VirtualHasOne # Provides virtual_has_one.
|
10
10
|
include VirtualModelName # Provides virtual_model_name.
|
11
|
+
include StiFixes # Fixes using RailsOps models with STI.
|
11
12
|
end
|
12
13
|
end
|
@@ -7,14 +7,29 @@ class RailsOps::Operation::Model::Update < RailsOps::Operation::Model::Load
|
|
7
7
|
true
|
8
8
|
end
|
9
9
|
|
10
|
+
policy :before_perform do
|
11
|
+
if model_authorization_action && self.class._model_authorization_lazy
|
12
|
+
authorize_model! model_authorization_action, model
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
10
16
|
def model_authorization
|
11
17
|
return unless authorization_enabled?
|
12
18
|
|
13
|
-
|
19
|
+
if self.class._model_authorization_lazy
|
20
|
+
if load_model_authorization_action.nil?
|
21
|
+
fail RailsOps::Exceptions::NoAuthorizationPerformed,
|
22
|
+
"Operation #{self.class.name} must specify a "\
|
23
|
+
'load_model_authorization_action because model '\
|
24
|
+
'authorization is configured to be lazy.'
|
25
|
+
else
|
26
|
+
authorize_model! load_model_authorization_action, model
|
27
|
+
end
|
28
|
+
elsif !load_model_authorization_action.nil?
|
14
29
|
authorize_model_with_authorize_only! load_model_authorization_action, model
|
15
30
|
end
|
16
31
|
|
17
|
-
unless model_authorization_action.nil?
|
32
|
+
unless model_authorization_action.nil? || self.class._model_authorization_lazy
|
18
33
|
authorize_model! model_authorization_action, model
|
19
34
|
end
|
20
35
|
end
|
data/lib/rails_ops.rb
CHANGED
@@ -88,6 +88,7 @@ require 'rails_ops/model_casting.rb'
|
|
88
88
|
require 'rails_ops/model_mixins.rb'
|
89
89
|
require 'rails_ops/model_mixins/ar_extension.rb'
|
90
90
|
require 'rails_ops/model_mixins/parent_op.rb'
|
91
|
+
require 'rails_ops/model_mixins/sti_fixes.rb'
|
91
92
|
require 'rails_ops/model_mixins/virtual_attributes.rb'
|
92
93
|
require 'rails_ops/model_mixins/virtual_attributes/virtual_column_wrapper.rb'
|
93
94
|
require 'rails_ops/model_mixins/virtual_has_one.rb'
|
data/rails_ops.gemspec
CHANGED
@@ -1,48 +1,46 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: rails_ops 1.1.
|
2
|
+
# stub: rails_ops 1.1.25 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "rails_ops".freeze
|
6
|
-
s.version = "1.1.
|
6
|
+
s.version = "1.1.25"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Sitrox".freeze]
|
11
|
-
s.date = "
|
12
|
-
s.files = [".
|
13
|
-
s.rubygems_version = "3.
|
11
|
+
s.date = "2022-01-17"
|
12
|
+
s.files = [".github/workflows/ruby.yml".freeze, ".gitignore".freeze, ".releaser_config".freeze, ".rubocop.yml".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "lib/generators/operation/USAGE".freeze, "lib/generators/operation/operation_generator.rb".freeze, "lib/generators/operation/templates/controller.erb".freeze, "lib/generators/operation/templates/create.erb".freeze, "lib/generators/operation/templates/destroy.erb".freeze, "lib/generators/operation/templates/load.erb".freeze, "lib/generators/operation/templates/update.erb".freeze, "lib/generators/operation/templates/view.erb".freeze, "lib/rails_ops.rb".freeze, "lib/rails_ops/authorization_backend/abstract.rb".freeze, "lib/rails_ops/authorization_backend/can_can_can.rb".freeze, "lib/rails_ops/configuration.rb".freeze, "lib/rails_ops/context.rb".freeze, "lib/rails_ops/controller_mixin.rb".freeze, "lib/rails_ops/exceptions.rb".freeze, "lib/rails_ops/hooked_job.rb".freeze, "lib/rails_ops/hookup.rb".freeze, "lib/rails_ops/hookup/dsl.rb".freeze, "lib/rails_ops/hookup/dsl_validator.rb".freeze, "lib/rails_ops/hookup/hook.rb".freeze, "lib/rails_ops/log_subscriber.rb".freeze, "lib/rails_ops/mixins.rb".freeze, "lib/rails_ops/mixins/authorization.rb".freeze, "lib/rails_ops/mixins/log_settings.rb".freeze, "lib/rails_ops/mixins/model.rb".freeze, "lib/rails_ops/mixins/model/authorization.rb".freeze, "lib/rails_ops/mixins/model/nesting.rb".freeze, "lib/rails_ops/mixins/param_authorization.rb".freeze, "lib/rails_ops/mixins/policies.rb".freeze, "lib/rails_ops/mixins/require_context.rb".freeze, "lib/rails_ops/mixins/routes.rb".freeze, "lib/rails_ops/mixins/schema_validation.rb".freeze, "lib/rails_ops/mixins/sub_ops.rb".freeze, "lib/rails_ops/model_casting.rb".freeze, "lib/rails_ops/model_mixins.rb".freeze, "lib/rails_ops/model_mixins/ar_extension.rb".freeze, "lib/rails_ops/model_mixins/parent_op.rb".freeze, "lib/rails_ops/model_mixins/sti_fixes.rb".freeze, "lib/rails_ops/model_mixins/virtual_attributes.rb".freeze, "lib/rails_ops/model_mixins/virtual_attributes/virtual_column_wrapper.rb".freeze, "lib/rails_ops/model_mixins/virtual_has_one.rb".freeze, "lib/rails_ops/model_mixins/virtual_model_name.rb".freeze, "lib/rails_ops/operation.rb".freeze, "lib/rails_ops/operation/model.rb".freeze, "lib/rails_ops/operation/model/create.rb".freeze, "lib/rails_ops/operation/model/destroy.rb".freeze, "lib/rails_ops/operation/model/load.rb".freeze, "lib/rails_ops/operation/model/update.rb".freeze, "lib/rails_ops/patches/active_type_patch.rb".freeze, "lib/rails_ops/profiler.rb".freeze, "lib/rails_ops/profiler/node.rb".freeze, "lib/rails_ops/railtie.rb".freeze, "lib/rails_ops/scoped_env.rb".freeze, "lib/rails_ops/virtual_model.rb".freeze, "rails_ops.gemspec".freeze, "test/db/models.rb".freeze, "test/db/schema.rb".freeze, "test/dummy/Rakefile".freeze, "test/dummy/app/assets/config/manifest.js".freeze, "test/dummy/app/assets/images/.keep".freeze, "test/dummy/app/assets/javascripts/application.js".freeze, "test/dummy/app/assets/javascripts/cable.js".freeze, "test/dummy/app/assets/javascripts/channels/.keep".freeze, "test/dummy/app/assets/stylesheets/application.css".freeze, "test/dummy/app/channels/application_cable/channel.rb".freeze, "test/dummy/app/channels/application_cable/connection.rb".freeze, "test/dummy/app/controllers/application_controller.rb".freeze, "test/dummy/app/controllers/concerns/.keep".freeze, "test/dummy/app/helpers/application_helper.rb".freeze, "test/dummy/app/jobs/application_job.rb".freeze, "test/dummy/app/mailers/application_mailer.rb".freeze, "test/dummy/app/models/animal.rb".freeze, "test/dummy/app/models/application_record.rb".freeze, "test/dummy/app/models/bird.rb".freeze, "test/dummy/app/models/cat.rb".freeze, "test/dummy/app/models/concerns/.keep".freeze, "test/dummy/app/models/dog.rb".freeze, "test/dummy/app/models/flower.rb".freeze, "test/dummy/app/models/group.rb".freeze, "test/dummy/app/models/nightingale.rb".freeze, "test/dummy/app/models/phoenix.rb".freeze, "test/dummy/app/models/user.rb".freeze, "test/dummy/app/views/layouts/application.html.erb".freeze, "test/dummy/app/views/layouts/mailer.html.erb".freeze, "test/dummy/app/views/layouts/mailer.text.erb".freeze, "test/dummy/bin/bundle".freeze, "test/dummy/bin/rails".freeze, "test/dummy/bin/rake".freeze, "test/dummy/bin/setup".freeze, "test/dummy/bin/update".freeze, "test/dummy/bin/yarn".freeze, "test/dummy/config.ru".freeze, "test/dummy/config/application.rb".freeze, "test/dummy/config/boot.rb".freeze, "test/dummy/config/cable.yml".freeze, "test/dummy/config/database.yml".freeze, "test/dummy/config/environment.rb".freeze, "test/dummy/config/environments/development.rb".freeze, "test/dummy/config/environments/production.rb".freeze, "test/dummy/config/environments/test.rb".freeze, "test/dummy/config/initializers/application_controller_renderer.rb".freeze, "test/dummy/config/initializers/assets.rb".freeze, "test/dummy/config/initializers/backtrace_silencers.rb".freeze, "test/dummy/config/initializers/cookies_serializer.rb".freeze, "test/dummy/config/initializers/filter_parameter_logging.rb".freeze, "test/dummy/config/initializers/inflections.rb".freeze, "test/dummy/config/initializers/mime_types.rb".freeze, "test/dummy/config/initializers/rails_ops.rb".freeze, "test/dummy/config/initializers/wrap_parameters.rb".freeze, "test/dummy/config/locales/en.yml".freeze, "test/dummy/config/puma.rb".freeze, "test/dummy/config/routes.rb".freeze, "test/dummy/config/secrets.yml".freeze, "test/dummy/config/spring.rb".freeze, "test/dummy/db/schema.rb".freeze, "test/dummy/lib/assets/.keep".freeze, "test/dummy/log/.keep".freeze, "test/dummy/package.json".freeze, "test/dummy/public/404.html".freeze, "test/dummy/public/422.html".freeze, "test/dummy/public/500.html".freeze, "test/dummy/public/apple-touch-icon-precomposed.png".freeze, "test/dummy/public/apple-touch-icon.png".freeze, "test/dummy/public/favicon.ico".freeze, "test/dummy/tmp/.keep".freeze, "test/test_helper.rb".freeze, "test/unit/rails_ops/generators/operation_generator_test.rb".freeze, "test/unit/rails_ops/mixins/model/nesting.rb".freeze, "test/unit/rails_ops/mixins/policies_test.rb".freeze, "test/unit/rails_ops/operation/model/create_test.rb".freeze, "test/unit/rails_ops/operation/model/load_test.rb".freeze, "test/unit/rails_ops/operation/model/sti_test.rb".freeze, "test/unit/rails_ops/operation/model/update_test.rb".freeze, "test/unit/rails_ops/operation/model_test.rb".freeze, "test/unit/rails_ops/operation/update_auth_test.rb".freeze, "test/unit/rails_ops/operation/update_lazy_auth_test.rb".freeze, "test/unit/rails_ops/operation_test.rb".freeze]
|
13
|
+
s.rubygems_version = "3.2.22".freeze
|
14
14
|
s.summary = "An operations service layer for rails projects.".freeze
|
15
|
-
s.test_files = ["test/db/models.rb".freeze, "test/db/schema.rb".freeze, "test/dummy/Rakefile".freeze, "test/dummy/app/assets/config/manifest.js".freeze, "test/dummy/app/assets/images/.keep".freeze, "test/dummy/app/assets/javascripts/application.js".freeze, "test/dummy/app/assets/javascripts/cable.js".freeze, "test/dummy/app/assets/javascripts/channels/.keep".freeze, "test/dummy/app/assets/stylesheets/application.css".freeze, "test/dummy/app/channels/application_cable/channel.rb".freeze, "test/dummy/app/channels/application_cable/connection.rb".freeze, "test/dummy/app/controllers/application_controller.rb".freeze, "test/dummy/app/controllers/concerns/.keep".freeze, "test/dummy/app/helpers/application_helper.rb".freeze, "test/dummy/app/jobs/application_job.rb".freeze, "test/dummy/app/mailers/application_mailer.rb".freeze, "test/dummy/app/models/application_record.rb".freeze, "test/dummy/app/models/concerns/.keep".freeze, "test/dummy/app/models/group.rb".freeze, "test/dummy/app/views/layouts/application.html.erb".freeze, "test/dummy/app/views/layouts/mailer.html.erb".freeze, "test/dummy/app/views/layouts/mailer.text.erb".freeze, "test/dummy/bin/bundle".freeze, "test/dummy/bin/rails".freeze, "test/dummy/bin/rake".freeze, "test/dummy/bin/setup".freeze, "test/dummy/bin/update".freeze, "test/dummy/bin/yarn".freeze, "test/dummy/config.ru".freeze, "test/dummy/config/application.rb".freeze, "test/dummy/config/boot.rb".freeze, "test/dummy/config/cable.yml".freeze, "test/dummy/config/database.yml".freeze, "test/dummy/config/environment.rb".freeze, "test/dummy/config/environments/development.rb".freeze, "test/dummy/config/environments/production.rb".freeze, "test/dummy/config/environments/test.rb".freeze, "test/dummy/config/initializers/application_controller_renderer.rb".freeze, "test/dummy/config/initializers/assets.rb".freeze, "test/dummy/config/initializers/backtrace_silencers.rb".freeze, "test/dummy/config/initializers/cookies_serializer.rb".freeze, "test/dummy/config/initializers/filter_parameter_logging.rb".freeze, "test/dummy/config/initializers/inflections.rb".freeze, "test/dummy/config/initializers/mime_types.rb".freeze, "test/dummy/config/initializers/rails_ops.rb".freeze, "test/dummy/config/initializers/wrap_parameters.rb".freeze, "test/dummy/config/locales/en.yml".freeze, "test/dummy/config/puma.rb".freeze, "test/dummy/config/routes.rb".freeze, "test/dummy/config/secrets.yml".freeze, "test/dummy/config/spring.rb".freeze, "test/dummy/db/schema.rb".freeze, "test/dummy/lib/assets/.keep".freeze, "test/dummy/log/.keep".freeze, "test/dummy/package.json".freeze, "test/dummy/public/404.html".freeze, "test/dummy/public/422.html".freeze, "test/dummy/public/500.html".freeze, "test/dummy/public/apple-touch-icon-precomposed.png".freeze, "test/dummy/public/apple-touch-icon.png".freeze, "test/dummy/public/favicon.ico".freeze, "test/dummy/tmp/.keep".freeze, "test/test_helper.rb".freeze, "test/unit/rails_ops/mixins/model/nesting.rb".freeze, "test/unit/rails_ops/mixins/policies_test.rb".freeze, "test/unit/rails_ops/operation/model/create_test.rb".freeze, "test/unit/rails_ops/operation/model/load_test.rb".freeze, "test/unit/rails_ops/operation/model/update_test.rb".freeze, "test/unit/rails_ops/operation/model_test.rb".freeze, "test/unit/rails_ops/operation_test.rb".freeze]
|
15
|
+
s.test_files = ["test/db/models.rb".freeze, "test/db/schema.rb".freeze, "test/dummy/Rakefile".freeze, "test/dummy/app/assets/config/manifest.js".freeze, "test/dummy/app/assets/images/.keep".freeze, "test/dummy/app/assets/javascripts/application.js".freeze, "test/dummy/app/assets/javascripts/cable.js".freeze, "test/dummy/app/assets/javascripts/channels/.keep".freeze, "test/dummy/app/assets/stylesheets/application.css".freeze, "test/dummy/app/channels/application_cable/channel.rb".freeze, "test/dummy/app/channels/application_cable/connection.rb".freeze, "test/dummy/app/controllers/application_controller.rb".freeze, "test/dummy/app/controllers/concerns/.keep".freeze, "test/dummy/app/helpers/application_helper.rb".freeze, "test/dummy/app/jobs/application_job.rb".freeze, "test/dummy/app/mailers/application_mailer.rb".freeze, "test/dummy/app/models/animal.rb".freeze, "test/dummy/app/models/application_record.rb".freeze, "test/dummy/app/models/bird.rb".freeze, "test/dummy/app/models/cat.rb".freeze, "test/dummy/app/models/concerns/.keep".freeze, "test/dummy/app/models/dog.rb".freeze, "test/dummy/app/models/flower.rb".freeze, "test/dummy/app/models/group.rb".freeze, "test/dummy/app/models/nightingale.rb".freeze, "test/dummy/app/models/phoenix.rb".freeze, "test/dummy/app/models/user.rb".freeze, "test/dummy/app/views/layouts/application.html.erb".freeze, "test/dummy/app/views/layouts/mailer.html.erb".freeze, "test/dummy/app/views/layouts/mailer.text.erb".freeze, "test/dummy/bin/bundle".freeze, "test/dummy/bin/rails".freeze, "test/dummy/bin/rake".freeze, "test/dummy/bin/setup".freeze, "test/dummy/bin/update".freeze, "test/dummy/bin/yarn".freeze, "test/dummy/config.ru".freeze, "test/dummy/config/application.rb".freeze, "test/dummy/config/boot.rb".freeze, "test/dummy/config/cable.yml".freeze, "test/dummy/config/database.yml".freeze, "test/dummy/config/environment.rb".freeze, "test/dummy/config/environments/development.rb".freeze, "test/dummy/config/environments/production.rb".freeze, "test/dummy/config/environments/test.rb".freeze, "test/dummy/config/initializers/application_controller_renderer.rb".freeze, "test/dummy/config/initializers/assets.rb".freeze, "test/dummy/config/initializers/backtrace_silencers.rb".freeze, "test/dummy/config/initializers/cookies_serializer.rb".freeze, "test/dummy/config/initializers/filter_parameter_logging.rb".freeze, "test/dummy/config/initializers/inflections.rb".freeze, "test/dummy/config/initializers/mime_types.rb".freeze, "test/dummy/config/initializers/rails_ops.rb".freeze, "test/dummy/config/initializers/wrap_parameters.rb".freeze, "test/dummy/config/locales/en.yml".freeze, "test/dummy/config/puma.rb".freeze, "test/dummy/config/routes.rb".freeze, "test/dummy/config/secrets.yml".freeze, "test/dummy/config/spring.rb".freeze, "test/dummy/db/schema.rb".freeze, "test/dummy/lib/assets/.keep".freeze, "test/dummy/log/.keep".freeze, "test/dummy/package.json".freeze, "test/dummy/public/404.html".freeze, "test/dummy/public/422.html".freeze, "test/dummy/public/500.html".freeze, "test/dummy/public/apple-touch-icon-precomposed.png".freeze, "test/dummy/public/apple-touch-icon.png".freeze, "test/dummy/public/favicon.ico".freeze, "test/dummy/tmp/.keep".freeze, "test/test_helper.rb".freeze, "test/unit/rails_ops/generators/operation_generator_test.rb".freeze, "test/unit/rails_ops/mixins/model/nesting.rb".freeze, "test/unit/rails_ops/mixins/policies_test.rb".freeze, "test/unit/rails_ops/operation/model/create_test.rb".freeze, "test/unit/rails_ops/operation/model/load_test.rb".freeze, "test/unit/rails_ops/operation/model/sti_test.rb".freeze, "test/unit/rails_ops/operation/model/update_test.rb".freeze, "test/unit/rails_ops/operation/model_test.rb".freeze, "test/unit/rails_ops/operation/update_auth_test.rb".freeze, "test/unit/rails_ops/operation/update_lazy_auth_test.rb".freeze, "test/unit/rails_ops/operation_test.rb".freeze]
|
16
16
|
|
17
17
|
if s.respond_to? :specification_version then
|
18
18
|
s.specification_version = 4
|
19
|
+
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
s.add_dependency(%q<rubocop>.freeze, ["= 0.47.1"])
|
35
|
-
s.add_dependency(%q<active_type>.freeze, [">= 1.3.0"])
|
36
|
-
s.add_dependency(%q<minitest>.freeze, [">= 0"])
|
37
|
-
s.add_dependency(%q<rails>.freeze, [">= 0"])
|
38
|
-
s.add_dependency(%q<request_store>.freeze, [">= 0"])
|
39
|
-
s.add_dependency(%q<schemacop>.freeze, [">= 2.4.2", "<= 3.1"])
|
40
|
-
end
|
21
|
+
if s.respond_to? :add_runtime_dependency then
|
22
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
23
|
+
s.add_development_dependency(%q<rake>.freeze, [">= 0"])
|
24
|
+
s.add_development_dependency(%q<sqlite3>.freeze, [">= 0"])
|
25
|
+
s.add_development_dependency(%q<cancancan>.freeze, [">= 0"])
|
26
|
+
s.add_development_dependency(%q<pry>.freeze, [">= 0"])
|
27
|
+
s.add_development_dependency(%q<colorize>.freeze, [">= 0"])
|
28
|
+
s.add_development_dependency(%q<rubocop>.freeze, ["= 0.47.1"])
|
29
|
+
s.add_development_dependency(%q<sprockets-rails>.freeze, [">= 0"])
|
30
|
+
s.add_runtime_dependency(%q<active_type>.freeze, [">= 1.3.0"])
|
31
|
+
s.add_runtime_dependency(%q<minitest>.freeze, [">= 0"])
|
32
|
+
s.add_runtime_dependency(%q<rails>.freeze, [">= 0"])
|
33
|
+
s.add_runtime_dependency(%q<request_store>.freeze, [">= 0"])
|
34
|
+
s.add_runtime_dependency(%q<schemacop>.freeze, [">= 2.4.2", "<= 3.1"])
|
41
35
|
else
|
42
36
|
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
43
37
|
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
44
38
|
s.add_dependency(%q<sqlite3>.freeze, [">= 0"])
|
39
|
+
s.add_dependency(%q<cancancan>.freeze, [">= 0"])
|
40
|
+
s.add_dependency(%q<pry>.freeze, [">= 0"])
|
41
|
+
s.add_dependency(%q<colorize>.freeze, [">= 0"])
|
45
42
|
s.add_dependency(%q<rubocop>.freeze, ["= 0.47.1"])
|
43
|
+
s.add_dependency(%q<sprockets-rails>.freeze, [">= 0"])
|
46
44
|
s.add_dependency(%q<active_type>.freeze, [">= 1.3.0"])
|
47
45
|
s.add_dependency(%q<minitest>.freeze, [">= 0"])
|
48
46
|
s.add_dependency(%q<rails>.freeze, [">= 0"])
|
@@ -0,0 +1 @@
|
|
1
|
+
class Animal < ApplicationRecord; end
|