2 # Returns a JSON string representing the enumerable. Any +options+
3 # given will be passed on to its elements. For example:
5 # users = User.find(:all)
6 # # => users.to_json(:only => :name)
8 # will pass the <tt>:only => :name</tt> option to each user.
9 def to_json(options
= {}) #:nodoc:
10 "[#{map { |value| ActiveSupport::JSON.encode(value, options) } * ', '}]"