validates_cpf 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/validates_cpf.rb CHANGED
@@ -7,6 +7,6 @@ require "validates_cpf/remarkable/require_a_valid_cpf_matcher" if defined?(::Rem
7
7
  class CpfValidator < ActiveModel::EachValidator
8
8
  def validate_each(record, attribute, value)
9
9
  key = :"activerecord.errors.models.#{record.class.name.downcase}.attributes.#{attribute.to_s}.invalid"
10
- record.errors[attribute] << I18n.t(key, :default => :"errors.messages.invalid") unless CPF.new(value).valid?
10
+ record.errors[attribute] << I18n.t(key, :default => :"activerecord.errors.messages.invalid") unless CPF.new(value).valid?
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module ValidatesCpf
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -4,6 +4,8 @@ describe CpfValidator do
4
4
  context "when cpf is invalid" do
5
5
  before :each do
6
6
  @user = User.new(:cpf => "12345")
7
+ I18n.stub(:t).with(:"activerecord.errors.models.user.attributes.cpf.invalid",
8
+ :default => :"activerecord.errors.messages.invalid").and_return("is invalid")
7
9
  end
8
10
 
9
11
  it "should set object as invalid" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_cpf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: