Skip to content

Instantly share code, notes, and snippets.

@sergueif
Created April 17, 2016 22:05
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 sergueif/e4cd636fb8a2616a35dff6d835de668d to your computer and use it in GitHub Desktop.
Save sergueif/e4cd636fb8a2616a35dff6d835de668d to your computer and use it in GitHub Desktop.
ActiveRecord to Value
class Account < ActiveRecord::Base
#id integer
#first_name string
#last_name string
class Value < Struct.new(:id, :first_name, :last_name)
end
def as_value
Value.new(id, first_name, last_name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment