danielweinmann/unlock

View on GitHub
app/policies/initiative_policy.rb

Summary

Maintainability
A
0 mins
Test Coverage
class InitiativePolicy < ApplicationPolicy

  def publish?
    update?
  end

  def revert_to_draft?
    update?
  end

  def update_states_from_gateways?
    update?
  end

  def permitted_attributes
    if create?
      [:name, :first_text, :second_text, :image, :permalink, :currency, :minimum_value]
    else
      []
    end
  end

end