Created
July 3, 2012 18:55
-
-
Save albus522/3041932 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Message | |
include ActiveModel::Conversion | |
include ActiveModel::Validations | |
extend ActiveModel::Naming | |
def initialize(attributes = {}) | |
attributes.each do |key, value| | |
eval "class << self; attr_accessor :#{key}; end" | |
send("#{key}=", value) | |
end | |
end | |
def persisted? | |
false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment