Skip to content

Instantly share code, notes, and snippets.

@mguterl
Created October 22, 2010 17:59
Show Gist options
  • Save mguterl/641041 to your computer and use it in GitHub Desktop.
Save mguterl/641041 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
has_one :candidate_profile
def candidate_profile
super || build_candidate_profile
end
end
user = User.last
user.candidate_profile # => super: no superclass method `candidate_profile' for #<User:0x10c639a90>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment