Skip to content

Commit

Permalink
Merge e8f5f17 into 0be9e22
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew committed Aug 26, 2013
2 parents 0be9e22 + e8f5f17 commit 6c65673
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/rails_admin/config/has_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ def field(name, type = nil, add_to_section = true, &block)
# Register a custom field type if one is provided and it is different from
# one found in default stack
elsif !type.nil? && type != (field.nil? ? nil : field.type)
_fields.delete(field) unless field.nil?
properties = abstract_model.properties.find {|p| name == p[:name] }
if !field.nil?
properties = field.properties
_fields.delete(field)
else
properties = abstract_model.properties.find {|p| name == p[:name] }
end
field = (_fields << RailsAdmin::Config::Fields::Types.load(type).new(self, name, properties)).last
end

Expand Down

0 comments on commit 6c65673

Please sign in to comment.