Created
November 14, 2012 20:03
-
-
Save rthbound/4074428 to your computer and use it in GitHub Desktop.
null_stubby.rb
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 Plan < ActiveRecord::Base | |
has_many :patients | |
attr_accessible :description | |
end | |
# Approach 1 | |
class NullPlan < Plan | |
end | |
# Approach from http://robots.thoughtbot.com/post/27572137956/tell-dont-ask (example 4) | |
class NullPlan | |
def description | |
"" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment