Sha256: 74e9db23aa5cf880d125c27c3551a69f024ae53880d59531abc4beefa34f3419

Contents?: true

Size: 760 Bytes

Versions: 7

Compression:

Stored size: 760 Bytes

Contents

class MembershipsController < ArtfullyOseController
  before_filter :load_tags, :only => [:index]

  def index
    @person = Person.find(params[:person_id])
    @membership_types = current_organization.membership_types
  end

  def bulk_update
    @person = Person.find(params[:person_id])
    extend_memberships(params)
    redirect_to person_memberships_path(@person)
  end

  private

    def extend_memberships(params)
      
      #I hate how these are tied to the button text
      if params[:commit].eql? "Change Expiration"
        params[:membership_ids].each do |membership_id|
          Membership.find(membership_id).adjust_expiration_to(params[:ends_at])
        end
        flash[:notice] = "Memberships have been adjusted."
      end
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.17 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.16 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.15 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.12 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.11 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.10 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.9 app/controllers/memberships_controller.rb