Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source
Show
Ignore:
Timestamp:
10/04/07 03:28:42 (1 year ago)
Author:
bitsweat
Message:

Hash#to_json takes :only or :except options to specific or omit certain hash keys. Enumerable#to_json passes through its options to each element. Closes #9751.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/lib/active_support/json/encoding.rb

    r7697 r7736  
    1818 
    1919      # Converts a Ruby object into a JSON string. 
    20       def encode(value
     20      def encode(value, options = {}
    2121        raise_on_circular_reference(value) do 
    22           value.send(:to_json
     22          value.send(:to_json, options
    2323        end 
    2424      end