spec/fake_app/user.rb in validates_cpf-2.0.1 vs spec/fake_app/user.rb in validates_cpf-3.0.0

- old
+ new

@@ -1,15 +1,10 @@ +# frozen_string_literal: true + class User - include ActiveModel::Validations - include ActiveModel::Conversion - extend ActiveModel::Naming + include ActiveModel::Model - attr_accessor :cpf, :name + attr_accessor :cpf, :masked_cpf, :name - validates :cpf, :cpf => true - - def initialize(attributes = {}) - attributes.each do |key, value| - instance_variable_set("@#{key}", value) - end - end -end \ No newline at end of file + validates :cpf, cpf: true + validates :masked_cpf, cpf: { mask: true } +end