scaffold_plus 1.7.9 → 1.7.10

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: 4d92d54b1ededafa0c8d51b9ef5e9601bb908f7d
4
- data.tar.gz: 485df74a3fbe76fe896a4328d1672a319d892aef
3
+ metadata.gz: f182f94e04c6614db4fc9ca1e8979b9b0c48cfe0
4
+ data.tar.gz: b8c2007e6096bd720b17c3ff12a8806e566d8beb
5
5
  SHA512:
6
- metadata.gz: eb677aab644abf3ae6be94db440c657568245080ac711f63743c6702c33905d290812f03a89a4d37aabf38ec47139758ad66d3a0bb893506a7e0a559b4e5e5ec
7
- data.tar.gz: 4218d0092e7576404d6d04973c1308f1dba8360e303686c786956c4a4be93ead42e9577e53bc577f2680f7ca9b7d009d9c9b97419ed191f68a1fa3bd717944b5
6
+ metadata.gz: 4a3ef8c01c65d272d066e51362b45f4fd736228e12054e2bcd488c3076aadcf4b1fecd87a33c957ec2df8ebe19d76eb9ba23c5f308e91008e765e66d2c4aaf1a
7
+ data.tar.gz: bd970931b042cf2d1660f5b40621a7174f5c63e6ae040f0c284c4827c7bd4e652023f972e54385d468412df1a1155a1095b62007a7db635581d77690d84969fd
@@ -55,9 +55,9 @@ module ScaffoldPlus
55
55
  text = before_array.include?(name) ? "\n" : ""
56
56
  text << " has_many :#{children}"
57
57
  text << ", inverse_of: :#{name}" if options.inverse?
58
- text << ", dependent: :#{dependent}" if options[:dependent].present?
58
+ text << ", dependent: :#{dependent}" if options.dependent.present?
59
59
  text << "\n"
60
- if options[:nested].present?
60
+ if options.nested.present?
61
61
  text << " accepts_nested_attributes_for :#{children}\n"
62
62
  end
63
63
  text << "\n" if after_array.include?(name)
@@ -68,8 +68,8 @@ module ScaffoldPlus
68
68
  inject_into_class "app/models/#{child}.rb", child.camelize do
69
69
  text = before_array.include?(child) ? "\n" : ""
70
70
  text << " belongs_to :#{name}"
71
- if options[:foreign_key].present?
72
- text << ", foreign_key: \"#{options[:foreign_key]}\""
71
+ if options.foreign_key.present?
72
+ text << ", foreign_key: \"#{options.foreign_key}\""
73
73
  end
74
74
  text << ", inverse_of: :#{children}" if options.inverse?
75
75
  text << ", counter_cache: true" if options.counter?
@@ -80,8 +80,8 @@ module ScaffoldPlus
80
80
  end
81
81
 
82
82
  def add_to_permit
83
- return unless options[:nested].present?
84
- list = options[:nested].map{|n| ":#{n}"}.join(', ')
83
+ return if options.nested.blank?
84
+ list = options.nested.map{|n| ":#{n}"}.join(', ')
85
85
  text = "#{children}_attributes: [ #{list} ]"
86
86
  file = "app/controllers/#{table_name}_controller.rb"
87
87
  gsub_file file, /(permit\(.*)\)/, "\\1, #{text})"
@@ -117,10 +117,10 @@ module ScaffoldPlus
117
117
  end
118
118
 
119
119
  def dependent
120
- if options[:dependent].present? && options[:dependent] == "restrict"
120
+ if options.dependent.present? and options.dependent == "restrict"
121
121
  "restrict_with_exception"
122
122
  else
123
- options[:dependent]
123
+ options.dependent
124
124
  end
125
125
  end
126
126
 
@@ -1,3 +1,3 @@
1
1
  module ScaffoldPlus
2
- VERSION = "1.7.9"
2
+ VERSION = "1.7.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffold_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.9
4
+ version: 1.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volker Wiegand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-26 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord