Skip to content

Using validators without class method #22

Description

@marcoschicote

Hi
I was wondering if it was possible to use the validators without using the class method. Instead of doing something like this:

class Server < ActiveRecord::Base
  validates_ip_address :address
end

I would like to write something like this:

class Server < ActiveRecord::Base
  validate :address, using: IpAddressValidator
end

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions