scaffold_plus 1.4.8 → 1.4.9
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cbd4ac6e5d9bc77ea4d359a7bc42e0984338db6
|
4
|
+
data.tar.gz: 7211cf2bc3394d729bc9c0aa36f72e60ea79ab9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 331edb6a0e4f373ff5a86af779781e0b158a5a070a8c698a2adcff505d5d26ad2804384b2d33ced8779eede0b85e2b9a1e0d4a4207e929161a636ff4217ad895
|
7
|
+
data.tar.gz: 6c5877fa87bfe29fa0b00660ff8122374f787fd05cb98b970a648c404e4ad3678fae516daa6c0d80645de8389bb073f0a80a0c885bda166b6b825e4c3b0c321f
|
@@ -21,11 +21,11 @@ module ScaffoldPlus
|
|
21
21
|
migration_template 'created_by_migration.rb', "db/migrate/#{migration_name}.rb"
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def update_model
|
25
25
|
lines = options.before? ? [ "" ] : []
|
26
26
|
lines << [
|
27
27
|
" def #{user}_data(action, attrib)",
|
28
|
-
" #{user.camelize}.find(
|
28
|
+
" #{user.camelize}.find(action).try(attrib)",
|
29
29
|
" end",
|
30
30
|
""
|
31
31
|
]
|
@@ -33,7 +33,7 @@ module ScaffoldPlus
|
|
33
33
|
inject_into_class "app/models/#{name}.rb", class_name, lines.join("\n")
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
36
|
+
def update_controller
|
37
37
|
file = "app/controllers/#{table_name}_controller.rb"
|
38
38
|
inject_into_file file, after: /def update$/ do
|
39
39
|
"\n @#{name}.updated_by = current_#{user}.id if current_#{user}"
|