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.6.27 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.26 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.25 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.24 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.24.pre.5 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.24.pre.4 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.24.pre.3 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.23 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.22 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.22.pre.3 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.22.pre.2 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.22.pre.1 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.21 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.21.pre.11 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.21.pre.10 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.21.pre.9 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.21.pre.8 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.21.pre.7 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.21.pre.6 pg_engine/app/policies/user_registration_policy.rb
pg_rails-7.6.21.pre.5 pg_engine/app/policies/user_registration_policy.rb