pundit_scaffold_generator 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/generators/policy_generator/rspec/rspec_generator.rb +5 -7
- data/lib/generators/policy_generator/scaffold/scaffold_generator.rb +0 -1
- data/lib/generators/scaffold/scaffold_generator.rb +1 -1
- data/lib/pundit_scaffold_generator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24aa20aaf6a9532a50996747bf5e328a12ba77a36a3c3ae6927bf8ac9466c8f1
|
4
|
+
data.tar.gz: c387fed68657af821af0797378ab0d08fc7d80eef45ccaeefde2abb8271f761b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94bddd1b1916210512cb344d34b66ab585247e0c6e40384c28160f11f5dc8787b63129e4bfc4bd1488f8fd0747d22dee319450d250e48ae9f3c10220a6436c75
|
7
|
+
data.tar.gz: 3c296b9e22bb51acb02526071bdea364372a5d7743ae9c382b121c4e6d837cd45afe62d28da062aa82183abc6d2ae8ff17745f688d24e94f60859979c9403618
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Rspec
|
4
|
-
|
5
|
-
|
6
|
-
source_root File.expand_path("templates", __dir__)
|
4
|
+
class PolicyGenerator < ::Rails::Generators::NamedBase
|
5
|
+
source_root File.expand_path("templates", __dir__)
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
end
|
7
|
+
def create_policy_spec
|
8
|
+
template "policy_spec.rb", File.join("spec/policies", class_path, "#{file_name}_policy_spec.rb")
|
11
9
|
end
|
12
|
-
|
10
|
+
end
|
13
11
|
end
|
@@ -2,7 +2,6 @@ module PolicyGenerator
|
|
2
2
|
module Generators
|
3
3
|
class ScaffoldGenerator < Rails::Generators::NamedBase
|
4
4
|
source_root File.expand_path('../templates', __FILE__)
|
5
|
-
puts "PolicyGenerator::Generators::ScaffoldGenerator"
|
6
5
|
|
7
6
|
def create_policy
|
8
7
|
template "policy.rb", File.join("app/policies", class_path, "#{file_name}_policy.rb")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rails/generators/rails/scaffold/scaffold_generator'
|
2
2
|
|
3
3
|
class Rails::Generators::ScaffoldGenerator
|
4
|
-
class_option :policy_generator, desc: '
|
4
|
+
class_option :policy_generator, desc: 'Generates the pundit policy',
|
5
5
|
default: 'policy_generator'
|
6
6
|
hook_for :policy_generator, required: true
|
7
7
|
end
|