Skip to content

Instantly share code, notes, and snippets.

@rthbound
Created November 14, 2012 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rthbound/4074428 to your computer and use it in GitHub Desktop.
Save rthbound/4074428 to your computer and use it in GitHub Desktop.
null_stubby.rb
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