Created
August 9, 2013 01:18
-
-
Save jackcallister/6190389 to your computer and use it in GitHub Desktop.
Model method delegation
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
# Delegate in a block to set up multiple delegations | |
with_options allow_nil: true do |product_delegate| | |
product_delegate.delegate :fields, to: :product_type | |
end | |
# Delegate as a method call | |
delegate :fields, to: :product_type, allow_nil: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment