small fix, removed before_create call back and added it to form
This commit is contained in:
parent
f72fc5bd9f
commit
069adb6c7b
|
@ -428,6 +428,7 @@ class RecruitmentsController < PseudoSessionController
|
||||||
|
|
||||||
def createprofile
|
def createprofile
|
||||||
profile = RecruitProfile.create(profile_params)
|
profile = RecruitProfile.create(profile_params)
|
||||||
|
# debugger
|
||||||
if profile.is_employer?
|
if profile.is_employer?
|
||||||
redirect_to mydashboard_path
|
redirect_to mydashboard_path
|
||||||
elsif profile.is_employee?
|
elsif profile.is_employee?
|
||||||
|
|
|
@ -22,15 +22,6 @@ class RecruitProfile
|
||||||
has_one :employer_profile, :autosave => true, :dependent => :destroy
|
has_one :employer_profile, :autosave => true, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :employer_profile, :allow_destroy => true
|
accepts_nested_attributes_for :employer_profile, :allow_destroy => true
|
||||||
|
|
||||||
before_create :disable_employer
|
|
||||||
|
|
||||||
|
|
||||||
def disable_employer
|
|
||||||
if self.is_employer?
|
|
||||||
self.enabled = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def disable_user
|
def disable_user
|
||||||
pu = PseudoUser.where(:user_name => self.pseudo_member_id).first
|
pu = PseudoUser.where(:user_name => self.pseudo_member_id).first
|
||||||
pu.enabled = false
|
pu.enabled = false
|
||||||
|
|
|
@ -181,7 +181,8 @@
|
||||||
<%= f.hidden_field :email, :value => current_pseudo_user.email %>
|
<%= f.hidden_field :email, :value => current_pseudo_user.email %>
|
||||||
<%= f.hidden_field :first_name, :value => current_pseudo_user.first_name %>
|
<%= f.hidden_field :first_name, :value => current_pseudo_user.first_name %>
|
||||||
<%= f.hidden_field :last_name, :value => current_pseudo_user.last_name %>
|
<%= f.hidden_field :last_name, :value => current_pseudo_user.last_name %>
|
||||||
<%= f.hidden_field :user_type, :value => "2" %>
|
<%= f.hidden_field :user_type, :value => "2" %>
|
||||||
|
<%= f.hidden_field :enabled, :value => "false" %>
|
||||||
<%= f.submit t("submit"), :class =>"btn btn-primary" %>
|
<%= f.submit t("submit"), :class =>"btn btn-primary" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue