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: c6035777cfdafc5a2c80c9136090ce1631751c31
4
- data.tar.gz: 6e5d126c06bbbfe1b7ec6ac935cd1f5f63e72b15
3
+ metadata.gz: d5093afc9ab1c33b2d9770e00b60f20743f4d0d0
4
+ data.tar.gz: 2c978a07bda1531c3a7860edafa6e237c7b8c360
5
5
  SHA512:
6
- metadata.gz: d21bea63bb5c8b7b60207d98e057d85c3aa5fe82e77dcfd03e6aa56f67f7d22d20e85633148a19f916039319d073b111f96a02231c02c921bfca108fe6a06b06
7
- data.tar.gz: d2b327bce2469327e04c6c10328afc69005b736954ed3309e8e57cfb30a6e975b36abd01dc0bff8ebd977596a9c829bdbbc899640571795e3d7ca404c0699ae3
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
- [ "created", "updated" ].each do |action|
26
- user_name = "#{user.camelize}.find(#{action}_by).try('name')"
27
- user_email = "#{user.camelize}.find(#{action}_by).try('email')"
28
- lines = options.before? ? [ "" ] : []
29
- lines << [
30
- " def #{action}_by_name",
31
- " #{user_name}",
32
- " end",
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
@@ -1,3 +1,3 @@
1
1
  module ScaffoldPlus
2
- VERSION = "1.4.7"
2
+ VERSION = "1.4.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffold_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.7
4
+ version: 1.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volker Wiegand