lightek_vpm 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/lightek_vpm/controller_generator.rb +4 -2
- data/lib/lightek_vpm/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: a5174bea46cd8b8348263d99d112459aa2b086bb53ca3afbb020415955ee9b21
|
4
|
+
data.tar.gz: 3bfa433d289aa16fbc0d9936d51749985eb82120bdc7d4e5507f73b86f4ffd92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b11e45ab39914c5550ed5fd4f182f9af62ff5c40e78089a2c515ad387d4c862a4ed71e959765af403035be8505d6afdf646df379889269b1ff60a4952f17d176
|
7
|
+
data.tar.gz: 1ffdf21efe7e20048e0a38c79ba1ce57fccab9e034dd6e617bc3a2e21dbecc0c6b6f816c5c16c9b00f3257661d2a46c96d1c8f51ad29aa2444d22fae36e7e12d
|
@@ -7,9 +7,11 @@ module LightekVpm
|
|
7
7
|
class ControllerGenerator < Rails::Generators::NamedBase
|
8
8
|
source_root File.expand_path('../templates', __FILE__)
|
9
9
|
include Rails::Generators::ResourceHelpers
|
10
|
+
include GeneratorHelpers # Include the GeneratorHelpers module
|
11
|
+
|
10
12
|
class_option :skip_show, type: :boolean, default: false, desc: 'Skip "show" action'
|
11
13
|
|
12
|
-
desc 'Generates controller, controller_spec and views for the model with the given NAME.'
|
14
|
+
desc 'Generates controller, controller_spec, and views for the model with the given NAME.'
|
13
15
|
|
14
16
|
def copy_controller_and_spec_files
|
15
17
|
template 'controller.rb', File.join('app/controllers', "#{controller_file_name}_controller.rb")
|
@@ -31,7 +33,7 @@ module LightekVpm
|
|
31
33
|
end
|
32
34
|
|
33
35
|
def add_abilities
|
34
|
-
ability_string = "n can :manage, #{class_name}, user_id: user.id"
|
36
|
+
ability_string = "\n can :manage, #{class_name}, user_id: user.id"
|
35
37
|
inject_into_file "#{Rails.root}/app/models/ability.rb", ability_string, after: /def initialize[a-z()]+/i
|
36
38
|
end
|
37
39
|
|
data/lib/lightek_vpm/version.rb
CHANGED