email_format_validator 1.0.1 → 1.0.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.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "email_format_validator"
6
- s.version = "1.0.1"
6
+ s.version = "1.0.2"
7
7
  s.authors = ["Axel Vergult"]
8
8
  s.email = ["axel.vergult@gmail.com"]
9
9
  s.homepage = "https://github.com/episko/email_format_validator"
@@ -23,7 +23,12 @@ class EmailFormatValidator < ActiveModel::EachValidator
23
23
  def validate_each(record, attribute, value)
24
24
  pattern_choosed = options[:rfc] ? Patterns::EMAIL : Patterns::LESS_RFC_COMPLIANT_EMAIL
25
25
  unless value =~ pattern_choosed
26
- record.errors.add(attribute, options[:message] || I18n.t(:improperly_formatted, :default => "is improperly formatted"))
26
+ record.errors.add(
27
+ attribute,
28
+ options[:message] || I18n.t(:improperly_formatted,
29
+ :scope => "activerecord.errors.models.#{record.class.name.underscore}.attributes.#{attribute}",
30
+ :default => "is improperly formatted")
31
+ )
27
32
  end
28
33
  end
29
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_format_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-14 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
16
- requirement: &70357299095340 !ruby/object:Gem::Requirement
16
+ requirement: &70319058845060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70357299095340
24
+ version_requirements: *70319058845060
25
25
  description: A Rails 3 email format validator with RFC 822 compliant option
26
26
  email:
27
27
  - axel.vergult@gmail.com