Sha256: c4c2bdfc7bb4d07c216dd005d12c6061e9a2108e80d73e00bbcc8b2623d9c6fd

Contents?: true

Size: 269 Bytes

Versions: 14

Compression:

Stored size: 269 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

14 entries across 14 versions & 1 rubygems

Version Path
tram-policy-2.2.0 spec/fixtures/user_policy.rb
tram-policy-2.1.0 spec/fixtures/user_policy.rb
tram-policy-2.0.1 spec/fixtures/user_policy.rb
tram-policy-2.0.0 spec/fixtures/user_policy.rb
tram-policy-1.0.1 spec/fixtures/user_policy.rb
tram-policy-1.0.0 spec/fixtures/user_policy.rb
tram-policy-0.4.0 spec/fixtures/user_policy.rb
tram-policy-0.3.1 spec/fixtures/user_policy.rb
tram-policy-0.3.0 spec/fixtures/user_policy.rb
tram-policy-0.2.5 spec/fixtures/user_policy.rb
tram-policy-0.2.4 spec/fixtures/user_policy.rb
tram-policy-0.2.3 spec/fixtures/user_policy.rb
tram-policy-0.2.2 spec/fixtures/user_policy.rb
tram-policy-0.2.1 spec/fixtures/user_policy.rb