Skip to content

Commit

Permalink
Fix a bug that would display association fields as simple textfields …
Browse files Browse the repository at this point in the history
…(not combo) in forms
  • Loading branch information
Sergei Kozlov committed Apr 22, 2012
1 parent 9bcfc2a commit a19808f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions lib/netzke/basepack/form_panel/fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,11 @@ def normalize_field(field)
def detect_association_with_method(c)
if c[:name].index('__')
assoc_name, method = c[:name].split('__').map(&:to_sym)
if assoc_method_type = data_adapter.get_assoc_property_type(assoc_name, method)
if c[:nested_attribute]
c[:xtype] ||= xtype_for_attr_type(assoc_method_type)
else
c[:xtype] ||= assoc_method_type == :boolean ? xtype_for_attr_type(assoc_method_type) : xtype_for_association
end
assoc_method_type = data_adapter.get_assoc_property_type(assoc_name, method)
if c[:nested_attribute]
c[:xtype] ||= xtype_for_attr_type(assoc_method_type)
else
c[:xtype] ||= assoc_method_type == :boolean ? xtype_for_attr_type(assoc_method_type) : xtype_for_association
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion netzke-basepack.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Sergei Kozlov"]
s.date = "2012-03-23"
s.date = "2012-04-22"
s.description = "A set of full-featured extendible Netzke components (such as FormPanel, GridPanel, Window, BorderLayoutPanel, etc) which can be used as building block for your RIA"
s.email = "[email protected]"
s.extra_rdoc_files = [
Expand Down
2 changes: 1 addition & 1 deletion test/basepack_test_app/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: vendor/gems/netzke-core
specs:
netzke-core (0.7.4)
netzke-core (0.7.5)
activesupport (>= 3.0.0)

PATH
Expand Down

0 comments on commit a19808f

Please sign in to comment.