Skip to content

Commit

Permalink
Make BelongsTo fields nullable
Browse files Browse the repository at this point in the history
Prior to this commit, there was no way to set a `belongs_to`
relationship to `nil` through the UI.
  • Loading branch information
seanpdoyle committed Dec 9, 2015
1 parent 4d2c5ac commit e1bab59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/administrate/fields/belongs_to.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def permitted_attribute
end

def associated_resource_options
candidate_resources.map do |resource|
[nil] + candidate_resources.map do |resource|
[display_candidate_resource(resource), resource.id]
end
end
Expand Down

0 comments on commit e1bab59

Please sign in to comment.