Skip to content

Commit

Permalink
Refactor previous commit a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva committed Oct 26, 2011
1 parent 7ba1e06 commit 45e6d90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/simple_form/inputs/collection_input.rb
Expand Up @@ -27,8 +27,10 @@ def input_options
private

def collection
collection = (options.delete(:collection) || self.class.boolean_collection)
@collection ||= collection.is_a?(Proc) ? collection.call : collection.to_a
@collection ||= begin
collection = options.delete(:collection) || self.class.boolean_collection
collection.respond_to?(:call) ? collection.call : collection.to_a
end
end

# Select components does not allow the required html tag.
Expand Down

0 comments on commit 45e6d90

Please sign in to comment.