You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
Formtastic is able to infer from ActiveRecord models which fields are required and mark them with an asterisk. It is not able to do this with DM 1.2.0. (marks all fields as required). However, the following monkeypatch makes it work in our app.
What would be the best way to contribute this, given that you're now working on 1.3.0 and 2.0?
module DataMapper::Validations::ClassMethods
def validators_on(attribute)
validators[attribute.to_sym] || []
end
end
class DataMapper::Validations::GenericValidator
def self.kind
@kind ||= name.split('::').last.sub(/Validator$/, '').downcase.to_sym
end
def kind
self.class.kind
end
end
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Formtastic is able to infer from ActiveRecord models which fields are required and mark them with an asterisk. It is not able to do this with DM 1.2.0. (marks all fields as required). However, the following monkeypatch makes it work in our app.
What would be the best way to contribute this, given that you're now working on 1.3.0 and 2.0?
The text was updated successfully, but these errors were encountered: