app/views/main/_belongs_to.html.erb in merb-admin-0.6.2 vs app/views/main/_belongs_to.html.erb in merb-admin-0.6.3
- old
+ new
@@ -3,11 +3,10 @@
collection = MerbAdmin::AbstractModel.new(association[:parent_model]).all.map{|o| [o.id, object_name(o)]}.sort_by{|o| o[1]}
selected = @object.send(child_key)
label = association[:pretty_name]
required = false
errors_exist = !(@object.errors[child_key].nil? || @object.errors[child_key].empty?)
- @properties.each do |property|
- next unless property[:name] == child_key
+ @properties.select{|property| property[:name] == child_key}.each do |property|
required = true unless property[:nullable?]
end
%>
<fieldset class="module aligned">
<h2><%= label %></h2>