1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport
Nicolás Hock Isaza da914fa35c Fixing as_json method for ActiveRecord models.
When you've got an AR Model and you override the `as_json` method,
you should be able to add default options to the renderer, like this:

    class User < ActiveRecord::Base
      def as_json(options = {})
        super(options.merge(:except => [:password_digest]))
      end
    end

This was not possible before this commit. See the added test case.
2011-09-29 21:44:23 -05:00
..
bin
lib Fixing as_json method for ActiveRecord models. 2011-09-29 21:44:23 -05:00
test Ensure that constantize just rescues NameError that applies to the constant being currently loaded. 2011-09-23 16:21:49 +02:00
activesupport.gemspec
CHANGELOG Update CHANGELOG for safe_constantize. 2011-09-23 16:49:05 +02:00
MIT-LICENSE
Rakefile
README.rdoc

= Active Support -- Utility classes and Ruby extensions from Rails

Active Support is a collection of utility classes and standard library
extensions that were found useful for the Rails framework. These additions
reside in this package so they can be loaded as needed in Ruby projects
outside of Rails.


== Download and installation

The latest version of Active Support can be installed with RubyGems:

  % [sudo] gem install activesupport

Source code can be downloaded as part of the Rails project on GitHub

* https://github.com/rails/rails/tree/master/activesupport


== License

Active Support is released under the MIT license.


== Support

API documentation is at

* http://api.rubyonrails.org

Bug reports and feature requests can be filed with the rest for the Ruby on Rails project here:

* https://github.com/rails/rails/issues