inline_forms 1.6.66 → 1.6.67
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTc5Zjk0NjkwMjYzMjVmYzE0MTRjMDhkMjNkMTAyNTc0ZjRlOWY0ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDAxNjM3NzVlNGQ4MGExOTRlZjI0Y2ZlZTlmNzdiMmRkMzgxZmFmOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGU3M2E2YTY4YWY4MGI3NDE5YmE4NTMzZGU3NTNlNzUxOTNjYWRjMWQ1Mzgz
|
10
|
+
Nzc5NGRmYWFmODc5Njg1ZTk5NWU2MWI4OTMwYmNhYWM1NWY3ZDcwMTczNTQz
|
11
|
+
NmQxZThmODg2Y2UyZmJlOWJlZjZjMmJlZmNlOTc0NGVhY2M2Y2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTFjMzkzYjIyNjEzMTY0NDcwMTA4ZTFiMjMxNTEwNmQ2YWMzN2JhMzYzYWE0
|
14
|
+
YThkYzhlYzEwNWM3YmQwYjQ0MDk3MWFiNzRlNGJjMGJkY2MwNWU2OGJiZTk5
|
15
|
+
Njk4NDgwYzViMTUxOGZkMzBmOGM2MmNkOWU5OTlkNzA0MjM2YzE=
|
@@ -140,8 +140,13 @@ def dropdown_with_other_update(object, attribute)
|
|
140
140
|
foreign_key = object.class.reflect_on_association(attribute.to_sym).options[:foreign_key] || attribute.foreign_key.to_sym
|
141
141
|
# if there is an attribute attr, then there must be an attribute attr_other
|
142
142
|
other = params[('_' + object.class.to_s.underscore).to_sym][(attribute + "_other").to_sym]
|
143
|
-
# see if it matches anything
|
144
|
-
|
143
|
+
# see if it matches anything (but we need to look at I18n too!
|
144
|
+
lookup_model = attribute.camelcase.constantize
|
145
|
+
name_field = 'name_' + I18n.locale.to_s
|
146
|
+
name_field = 'name' unless lookup_model.new.respond_to? name_field
|
147
|
+
puts 'XXXXXXXXXXXXXXXXXXXX ' + name_field.inspect
|
148
|
+
match = lookup_model.where(name_field.to_sym => other).first # problem if there are dupes!
|
149
|
+
puts 'XXXXXXXXXXXXXXXXXXXX ' + match.inspect
|
145
150
|
match.nil? ? object[foreign_key] = 0 : object[foreign_key] = match.id # problem if there is a record with id: 0 !
|
146
151
|
match.nil? ? object[attribute + '_other'] = other : object[attribute + '_other'] = nil
|
147
152
|
end
|
data/lib/inline_forms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ace Suares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rvm
|