scaffold_plus 1.4.7 → 1.4.8
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: d5093afc9ab1c33b2d9770e00b60f20743f4d0d0
|
4
|
+
data.tar.gz: 2c978a07bda1531c3a7860edafa6e237c7b8c360
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4222fe33954175d81aa00a06b3e7a9a4cfdc89d9036673018f5a1800ff48851f1415c4b09e89d6d6125aef3b4e0062bf9f9ead63bc4f5e0f3453fb40e0e7d131
|
7
|
+
data.tar.gz: 0cd4b1ef77b88fd3a1abf58fd404f6746aa082921070e6101ba1108b388af7d43a3db9ef1ccbcd98357316e34d6f11ac1dfdeb3ec16ab64ef739f7f76e5bb5a3
|
@@ -22,29 +22,15 @@ module ScaffoldPlus
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def add_to_model
|
25
|
-
[ "
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
]
|
35
|
-
lines << [ "" ] if options.after?
|
36
|
-
inject_into_class "app/models/#{name}.rb", class_name, lines.join("\n")
|
37
|
-
|
38
|
-
lines = options.before? ? [ "" ] : []
|
39
|
-
lines << [
|
40
|
-
" def #{action}_by_email",
|
41
|
-
" #{user_name} <#{user_email}>",
|
42
|
-
" end",
|
43
|
-
""
|
44
|
-
]
|
45
|
-
lines << [ "" ] if options.after?
|
46
|
-
inject_into_class "app/models/#{name}.rb", class_name, lines.join("\n")
|
47
|
-
end
|
25
|
+
lines = options.before? ? [ "" ] : []
|
26
|
+
lines << [
|
27
|
+
" def #{user}_data(action, attrib)",
|
28
|
+
" #{user.camelize}.find(#{action}d_by).try('#{attrib}')",
|
29
|
+
" end",
|
30
|
+
""
|
31
|
+
]
|
32
|
+
lines << [ "" ] if options.after?
|
33
|
+
inject_into_class "app/models/#{name}.rb", class_name, lines.join("\n")
|
48
34
|
end
|
49
35
|
|
50
36
|
def add_to_controller
|