Sha256: e3de46067508c6afbf7a02d735c82e66c876775c8bd3605550995f6ba52b08d7
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
Contents
= better_delegation Better method delegation for ActiveRecord. Specifically when it comes to handling 'nil' objects. While Rails does support method delegation to a nil object, it will always return 'nil' if the object delegated to is nil. This gem will return whatever the object delegated to would return. It's especially useful for example when you have a method that would typically return 'false' (because that's what the database column default is set to). For example an `is_active` method might return false by default. When the delegating object calls `is_active` on a nil object, the nil object would return 'false', not nil. == Note on Patches/Pull Requests * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) * Send me a pull request. Bonus points for topic branches. == Copyright Copyright (c) 2009 Josh N. Abbott. See LICENSE for details.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
better_delegation-1.0.0 | README.rdoc |