app/controllers/user_reports_controller.rb
# would like this to support generic updating of model with
# business logic pulled into a separate model or process
would like this to support generic updating of model with
business logic pulled into a separate model or process
would like this to support generic updating of model with business logic pulled into a separate model or process
def update
    user = User.find_by_id(params[:id])
    if params[:pending_org_action] == "decline"
      UserOrganisationDecliner.new(self, user, current_user).call
    elsif params[:pending_org_action] == "approve"
      UserOrganisationClaimer.new(self, user, current_user).call(params[:organisation_id])
    end
  end
def update user = User . find_by_id ( params [ :id ] ) if params [ :pending_org_action ] == "decline" UserOrganisationDecliner . new ( self , user , current_user ) . call elsif params [ :pending_org_action ] == "approve" UserOrganisationClaimer . new ( self , user , current_user ) . call ( params [ :organisation_id ] ) end end
would like this to support generic updating of model with
business logic pulled into a separate model or process
would like this to support generic updating of model with business logic pulled into a separate model or process