Created
January 13, 2011 02:46
-
-
Save alindeman/777312 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Model < ActiveRecord::Base | |
| # Just as an example, encode as JSON/XML | |
| # excluding the created_at attribute | |
| def serializable_hash(options = nil) | |
| options ||= {} | |
| (options[:except] ||= []) << :created_at | |
| super(options) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment