validate_as_url 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,7 +47,7 @@ module ValidateAsUrl
47
47
  options.update(attr_names.pop) if attr_names.last.is_a?(Hash)
48
48
 
49
49
  validates_each(attr_names, options) do |record, attr_name, value|
50
- errors = ValidateAsUrl::validate_as_url(value.to_s, options)
50
+ errors = ::ValidateAsUrl::validate_as_url(value.to_s, options)
51
51
  errors.each do |error|
52
52
  record.errors.add(attr_name, error)
53
53
  end unless errors.nil?
@@ -59,7 +59,7 @@ end
59
59
  if defined?(ActiveModel)
60
60
  class AsUrlValidator < ActiveModel::EachValidator
61
61
  def validate_each(record, attribute, value)
62
- err = ValidateAsUrl::validate_as_url(value, options)
62
+ err = ::ValidateAsUrl::validate_as_url(value, options)
63
63
  unless err.nil?
64
64
  record.errors[attribute] << err
65
65
  record.errors[attribute].flatten!
@@ -69,13 +69,13 @@ if defined?(ActiveModel)
69
69
 
70
70
  module ActiveModel::Validations::HelperMethods
71
71
  def validate_as_url(*attr_names)
72
- validates_with AsUrlValidator, _merge_attributes(attr_names)
72
+ validates_with ::AsUrlValidator, _merge_attributes(attr_names)
73
73
  end
74
74
  end
75
75
  else
76
76
  if defined?(ActiveRecord)
77
77
  class ActiveRecord::Base
78
- extend AsUrlValidator::Validations
78
+ extend ::AsUrlValidator::Validations
79
79
  end
80
80
  end
81
81
  end
@@ -4,7 +4,7 @@
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "validate_as_url"
7
- spec.version = '0.0.3'
7
+ spec.version = '0.0.4'
8
8
  spec.author = ["Mitrofanov Dmitry"]
9
9
  spec.email = ["mdima@it-guru.biz"]
10
10
  spec.description = %q{This Gem is Used for Validations URLs}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validate_as_url
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: