Skip to content

Instantly share code, notes, and snippets.

@nowk
Last active December 15, 2015 08:18
Show Gist options
  • Save nowk/5229427 to your computer and use it in GitHub Desktop.
Save nowk/5229427 to your computer and use it in GitHub Desktop.
class TablelessModel
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
def initialize(attributes = {})
attributes.try(:each) do |name, value|
send("#{name}=", 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