app/controllers/memberships_controller.rb in artfully_ose-1.2.0.beta.1 vs app/controllers/memberships_controller.rb in artfully_ose-1.2.0.pre
- old
+ new
@@ -1,27 +1,25 @@
class MembershipsController < ArtfullyOseController
before_filter :load_tags, :only => [:index]
def index
- @person = current_organization.people.find(params[:person_id])
- @expired_count = @person.memberships.lapsed.count
- @membership_types = current_organization.membership_types
+ @person = Person.find(params[:person_id])
end
def bulk_update
- @person = current_organization.people.find(params[:person_id])
+ @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"
+ if params[:commit].eql? "Extend Memberships"
params[:membership_ids].each do |membership_id|
- current_organization.memberships.find(membership_id).adjust_expiration_to(params[:ends_at])
+ Membership.find(membership_id).adjust_expiration_to(params[:ends_at])
end
flash[:notice] = "Memberships have been adjusted."
end
end
end
\ No newline at end of file