Sha256: f674d93ec9e0dffbbf1538005594101c9dff6cc9826fa55759ccadf567c4b878

Contents?: true

Size: 258 Bytes

Versions: 5

Compression:

Stored size: 258 Bytes

Contents

class YoutubeValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    record.errors[attribute] << (options[:message] || "- используются недопустимые символы") if value =~ /[^A-z0-9_-]/
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
redditor-0.1.22 app/validators/youtube_validator.rb
redditor-0.1.20 app/validators/youtube_validator.rb
redditor-0.1.17 app/validators/youtube_validator.rb
redditor-0.1.16 app/validators/youtube_validator.rb
redditor-0.1.15 app/validators/youtube_validator.rb