rails_validation_api 1.2.3 → 1.2.4

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: 0f8b0173edc6150f0f3da1222f676773aa9546df4eeeeee80e0b0c4807a14a9c
4
- data.tar.gz: 31d304de82e0e4e467e4d24bc2fea7fb53904e4aa9a440d9cdc8d5193d429df1
3
+ metadata.gz: 83ba96c72236af10ef1179343132ef56d9f9b83e00daaa79cb40b0380dfbcbb7
4
+ data.tar.gz: 0673b7734ebda2392018999e750b171daecb63c65904ba98011625ed86c9e3d1
5
5
  SHA512:
6
- metadata.gz: 4f3e4352a23015c25f7d2dfabf4fcd6354db63222b7a543ffd52497f8f4ab256e1b52b2fea6ad009df82b29421bacb4d797b29605bc45983449dcc265f0ed0f7
7
- data.tar.gz: afe6fb7862f8f704bfea8bbabc8dde452e6590f8e64f5acd19b3b8bda7f980d595156c00a5074593b2bc6aa600206161568e3badb0e86eb8c220f28b1c4685d1
6
+ metadata.gz: b1f6669cc6aa2ddf529280dd74558f13e77147db34af9b23e80a792187248dfb8c293a34723c01d18880b9e5ada817656c3da10e046d4b2663196e35b56651d5
7
+ data.tar.gz: 18ca8b1b28f3a2675db6dc344b4b64ea0630faeefa18649382b2f6cd7cf801e56c5883d1cdf0da026f2b73570a3f55a126be697e025c46667f274a0be8b7e6bd
@@ -1,7 +1,6 @@
1
1
  puts <<~TEXT
2
2
  -------------------------------------------------------------------------------------------------------------------------------------------------
3
- | Add "include AutoLoadRailsValidationApi" to your controller ex: API::BaseController < ApplicationController to use the RailsValidationApi |
4
- | Add "config.autoload_paths += %w(\#{config.root}/app/validators/)" in config/application.rb to autoload validators. |
3
+ | Install: bundle exec rails generate rails_validation_api:install |
5
4
  |-----------------------------------------------------------------------------------------------------------------------------------------------| |
6
5
  | To use the RailsValidationApi, you need to add the following line to your Gemfile: |
7
6
  | Usage: bundle exec rails_validation_api <command> [name] |
@@ -0,0 +1,13 @@
1
+ require "rails/generators"
2
+
3
+ module RailsValidationApi
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def copy_initializer
9
+ template "rails_validation_api.rb", "config/initializers/rails_validation_api.rb"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ require "auto_load_rails_validation_api"
2
+
3
+ Rails.application.config.autoload_paths += %W(#{Rails.root}/app/validators)
4
+
5
+ ActiveSupport.on_load(:action_controller) do
6
+ include AutoLoadRailsValidationApi
7
+ end
@@ -28,6 +28,7 @@ module RailsValidationApi
28
28
  raise RailsValidationApi::Error.new(error[:field], :unprocessable_entity, error[:message])
29
29
  end
30
30
  end
31
+ nil
31
32
  end
32
33
 
33
34
  private
@@ -1,3 +1,3 @@
1
1
  module RailsValidationApi
2
- VERSION = "1.2.3"
2
+ VERSION = "1.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_validation_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linh Nguyen Quang
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: railties
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '5.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '5.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: debug
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +110,8 @@ files:
96
110
  - exe/commands/usage.rb
97
111
  - exe/rails_validation_api
98
112
  - lib/auto_load_rails_validation_api.rb
113
+ - lib/generators/rails_validation_api/install_generator.rb
114
+ - lib/generators/rails_validation_api/templates/rails_validation_api.rb
99
115
  - lib/rails_validation_api.rb
100
116
  - lib/rails_validation_api/dsl.rb
101
117
  - lib/rails_validation_api/validator.rb