Sha256: 192b20a5b0efe5dc5d7f955d74fe9b54d39de22614ae94f3c1f58e0a4d366493

Contents?: true

Size: 699 Bytes

Versions: 5

Compression:

Stored size: 699 Bytes

Contents

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

  def index
    @person = Person.find(params[:person_id])
  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? "Extend Memberships"
        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

5 entries across 5 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.4 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.3 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.2 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre.1 app/controllers/memberships_controller.rb
artfully_ose-1.2.0.pre app/controllers/memberships_controller.rb