Sha256: 4259f278438d6c8526daa00c7765a9b5fda369936d48892ce8bd1dd9c643f884

Contents?: true

Size: 268 Bytes

Versions: 2

Compression:

Stored size: 268 Bytes

Contents

class Test::UserPolicy < Tram::Policy
  param :user

  validate :name
  validate "email"
  validate "name"

  private

  def name
    errors.add "No name", level: "warning" unless user.name
  end

  def email
    user.email
  end

  def login
    user.login
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tram-policy-0.2.0 spec/fixtures/user_policy.rb
tram-policy-0.1.1 spec/fixtures/user_policy.rb