attended field as true in new registrations created by admin

This commit is contained in:
differentreality 2013-07-12 10:24:51 +03:00
parent 949cbd6a6c
commit 5437cd5226
2 changed files with 4 additions and 4 deletions

View file

@ -44,7 +44,7 @@ class Admin::UsersController < ApplicationController
person.update_attributes(params[:user][:people])
begin
params[:user][:conferences].each do |r|
registration = person.registrations.new(:conference_id => r)
registration = person.registrations.new(:conference_id => r, :attended => 't')
registration.save!
end
redirect_to admin_conference_registrations_path(@conference.short_title)
@ -61,4 +61,4 @@ class Admin::UsersController < ApplicationController
redirect_to(:back, :alert => "Please select at least one conference to register.")
end
end
end
end

View file

@ -10,9 +10,9 @@ class Registration < ActiveRecord::Base
attr_accessible :person_id, :conference_id, :attending_social_events, :attending_with_partner,
:using_affiliated_lodging, :arrival, :departure, :person_attributes, :other_dietary_choice, :dietary_choice_id,
:handicapped_access_required, :supporter_registration_attributes, :social_event_ids, :other_special_needs,
:event_ids
:event_ids, :attended
accepts_nested_attributes_for :person
accepts_nested_attributes_for :supporter_registration
accepts_nested_attributes_for :social_events
end
end