Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AndyObtiva/962793 to your computer and use it in GitHub Desktop.
Save AndyObtiva/962793 to your computer and use it in GitHub Desktop.
Ruby conditional code that makes me cry
extra_attributes.each do |name, value|
case name.to_sym
when :fullname
self.fullname = value
when :email
self.email = value
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment