Created
October 6, 2014 14:06
-
-
Save adz/6b7e21689c7540a46567 to your computer and use it in GitHub Desktop.
Simple null object
This file contains 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 Client < ActiveRecord::Base | |
belongs_to :pricing_level | |
end | |
class PricingLevel | |
def self.find_default | |
#... | |
end | |
end | |
class Guest | |
def name | |
'Guest' | |
end | |
def pricing_level | |
PricingLevel.find_default | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment