Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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