Skip to Content Skip to Search
Methods
P
S
U

Instance Public methods

plans()

# File engines/member/app/controllers/member/accounts_controller.rb, line 30
def plans
  @recurring = current_member.plans.where({plan_type: "subscription"})
  @pseudo_recurring = current_member.subscriptions.includes(:plan).joins(:plan)
    .where(plans: {plan_type: "payment", id: member_plan_ids})
  @non_recurring = current_member.plans.where({plan_type: %w[free charge]})
end

setup_member()

# File engines/member/app/controllers/member/accounts_controller.rb, line 37
def setup_member
  @member = current_member
  @custom_fields = current_site.custom_fields.select { |f| f.display? && !f.after_signup? }
end

show()

# File engines/member/app/controllers/member/accounts_controller.rb, line 5
def show
  js_redirect_to(current_site.widget_url(request.path))
end

update()

# File engines/member/app/controllers/member/accounts_controller.rb, line 9
def update
  updator = MemberUpdator.new(member: current_member, password: current_member.password)

  if updator.update(member_params)
    flash[:success] = I18n.t("member.alerts.profile_updated_success", site_id: current_site.id)
    redirect_to account_path
  else
    render :edit
  end
end

update_custom_fields()

# File engines/member/app/controllers/member/accounts_controller.rb, line 20
def update_custom_fields
  @plan = DB::Plan.find(accounts_params[:id])
  updator = MemberUpdator.new(member: current_member, password: current_member.password)
  if updator.update(member_params, @plan.id)
    render partial: "after_signup_fields"
  else
    render json: {error: custom_fields_errors}, status: :unprocessable_entity
  end
end