grape-utils 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b06a9ea4aa2398f2825175fe9992e39c5353e44c6d80838ab2458975d8d3ce1
4
- data.tar.gz: b0a71606237e35d2c923571fb7ffb1f0b1a9afdb7fdae7d111a93ded902e4bb4
3
+ metadata.gz: ef47cedcf6d6b228a63b333588b0b4584507e76c789bbd1369f410ea18f0d3da
4
+ data.tar.gz: 9fe046f1bae7baaf3f8f345ff707d0834f45a7628b73ae7b19d597fbb9bdf556
5
5
  SHA512:
6
- metadata.gz: c33be00c3a8b029b9d03d278f9cba246056f243cfe7fe70386aa0b8bacd64a9cc0c5d9c1efbfc5a55101f1d99fba2edf224ad9b648b00523dcc65176b0db7402
7
- data.tar.gz: 0d7b08fd62151141aeb3a438b95d932fbec51132b81e10736afc85b341e9a6873d170f16b76ebe4105b5d8dc647bef03525e4deb063d294edef144e69eb07a02
6
+ metadata.gz: b5618748f67074dee49ef43052c1f7cb51a574b728ae63f9477baf4c7c2c54f6fa84c45ecc2842542a35ba3f27fe24a2f1d4cf67ec2b1af5af6bb3fffb44294d
7
+ data.tar.gz: b8f2463327b068e6c119a3104c9a796054eb0761e4915cf8211df65630d7d7e10c5e81ff584e4c6300a33058b40894ed5f7ed508a173d44a15eed2acc8e9a010
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape-utils (0.1.0)
4
+ grape-utils (0.1.1)
5
5
  grape
6
6
  grape-entity
7
7
  grape-kaminari
@@ -8,7 +8,7 @@ module Grape
8
8
  helpers Grape::Utils::Helpers
9
9
 
10
10
  mounted do
11
- desc "Creates an instance of #{configuration[:model].class_name}"
11
+ desc "Creates an instance of #{configuration[:model].name}"
12
12
  params do
13
13
  requires :none, except: configuration[:required_params],
14
14
  using: configuration[:entity].documentation
@@ -6,7 +6,9 @@ module Grape
6
6
  # Adds all requests necessary to CRUD the resource
7
7
  class Crud < ::Grape::API
8
8
  mounted do
9
- mount Templates::Index, with: { index: configuration[:index], entity: configuration[:entity] }
9
+ mount Templates::Index, with: { model: configuration[:model],
10
+ index: configuration[:index],
11
+ entity: configuration[:entity] }
10
12
 
11
13
  mount Templates::Create, with: { model: configuration[:model],
12
14
  entity: configuration[:entity],
@@ -9,7 +9,7 @@ module Grape
9
9
 
10
10
  mounted do
11
11
  route_param :id, type: String do
12
- desc "Deletes an instances of #{configuration[:model].class_name}"
12
+ desc "Deletes an instances of #{configuration[:model].name}"
13
13
  delete do
14
14
  resource = configuration[:model].find_by!((configuration[:column_id] || :id) => params[:id])
15
15
  resource.destroy!
@@ -11,7 +11,7 @@ module Grape
11
11
  helpers Grape::Utils::Helpers
12
12
 
13
13
  mounted do
14
- desc "Lists all #{configuration[:model].class_name}"
14
+ desc "Lists all #{configuration[:model].name}"
15
15
  params do
16
16
  use :pagination, per_page: 10, max_per_page: 30
17
17
  end
@@ -9,7 +9,7 @@ module Grape
9
9
 
10
10
  mounted do
11
11
  route_param :id, type: String do
12
- desc "Details of a #{configuration[:model].class_name}"
12
+ desc "Details of a #{configuration[:model].name}"
13
13
  get do
14
14
  resource = configuration[:model].find_by!((configuration[:column_id] || :id) => params[:id])
15
15
  present resource, with: configuration[:entity]
@@ -9,7 +9,7 @@ module Grape
9
9
 
10
10
  mounted do
11
11
  route_param :id, type: String do
12
- desc "Updates a #{configuration[:model].class_name}"
12
+ desc "Updates a #{configuration[:model].name}"
13
13
  params do
14
14
  requires :none, using: configuration[:entity].documentation
15
15
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Grape
4
4
  module Utils
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nix41
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-22 00:00:00.000000000 Z
11
+ date: 2024-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape