Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created February 7, 2012 21:16
Show Gist options
  • Save josevalim/1762005 to your computer and use it in GitHub Desktop.
Save josevalim/1762005 to your computer and use it in GitHub Desktop.
Custom AMo model for forms
class LintTest < ActiveSupport::TestCase
include ActiveModel::Lint::Tests
class Model
# model.to_model
include ActiveModel::Conversion
# Implements Model.model_name
extend ActiveModel::Naming
# model.valid?, model.errors
include ActiveModel::Validations
# Since this object is not persisted,
# set persisted to false.
def persisted?() false end
end
def setup
@model = Model.new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment