Sha256: db39394dc09e39f292ef12d31019c64e67b5125fb95fe07b20c04de73a19ac71

Contents?: true

Size: 264 Bytes

Versions: 7

Compression:

Stored size: 264 Bytes

Contents

class ValidateCommentsCustomTarget < UseCase::Validator

  def target
    [
      context.post.comments[0],
      context.post.comments[1]
    ]
  end

  validates_presence_of :title
  
  validates_format_of :email, with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
usecasing_validations-0.7.0 spec/support/usecases/validate_comments_custom_target.rb
usecasing_validations-0.6.0 spec/support/usecases/validate_comments_custom_target.rb
usecasing_validations-0.5.5 spec/support/usecases/validate_comments_custom_target.rb
usecasing_validations-0.5.4 spec/support/usecases/validate_comments_custom_target.rb
usecasing_validations-0.5.3 spec/support/usecases/validate_comments_custom_target.rb
usecasing_validations-0.5.1 spec/support/usecases/validate_comments_custom_target.rb
usecasing_validations-0.5.0 spec/support/usecases/validate_comments_custom_target.rb