Sha256: 015a061a4e92da8e61c1edf52b54c59ea731dd443ad3018cc24639040490121e

Contents?: true

Size: 307 Bytes

Versions: 120

Compression:

Stored size: 307 Bytes

Contents

# frozen_string_literal: true

class UserRegistrationPolicy
  attr_reader :user, :record

  def initialize(user, record)
    @user = user
    @record = record
  end

  def new?
    create?
  end

  def create?
    user.blank?
  end

  def edit?
    update?
  end

  def update?
    user == record
  end
end

Version data entries

120 entries across 120 versions & 1 rubygems

Version Path
pg_rails-7.0.8.pre.alpha.101 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.100 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.99 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.98 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.97 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.96 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.95 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.94 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.93 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.92 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.91 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.90 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.89 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.88 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.87 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.86 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.56 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.55 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.54 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.0.8.pre.alpha.53 pg_engine/app/policies/user_registration_policy.rb