Created
April 17, 2016 22:05
-
-
Save sergueif/e4cd636fb8a2616a35dff6d835de668d to your computer and use it in GitHub Desktop.
ActiveRecord to Value
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 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