-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started merging PendingVolunteer to Volunteer as Volunteer.needs_revi…
…ew=true * Added Volunteer.needs_review * Updated the pending volunteer controller and the accompanying tests accordingly. One test still failing. * Commented out the Pending* classes to find all relevant code that needs to be updated. This should leave the tables in the db.
- Loading branch information
1 parent
ccd5d1a
commit 799f890
Showing
28 changed files
with
210 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,5 +265,3 @@ table.header-border { | |
.background-invalid { | ||
background-color: LightPink !important; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
class PendingVolunteer < ActiveRecord::Base | ||
has_many :pending_volunteer_interests, dependent: :destroy | ||
has_many :interests, through: :pending_volunteer_interests | ||
belongs_to :volunteers | ||
has_one :volunteer | ||
|
||
before_save :save_phone | ||
|
||
validates :first_name, presence: true | ||
validates :last_name, presence: true | ||
|
||
def name | ||
[first_name, last_name].join(' ') | ||
end | ||
|
||
def self.resolve_fields_table | ||
resolve_fields = {} | ||
index = 0 | ||
[:first_name, :last_name, :address, :city, :state, :zip, :email, :home_phone, :work_phone, :mobile_phone].each do |f| | ||
resolve_fields[f] = index | ||
index += 1 | ||
end | ||
resolve_fields | ||
end | ||
|
||
private | ||
|
||
def save_phone | ||
if self.phone | ||
self.home_phone = self.phone | ||
self.work_phone = self.phone | ||
self.mobile_phone = self.phone | ||
end | ||
end | ||
|
||
end | ||
# class PendingVolunteer < ActiveRecord::Base | ||
# has_many :pending_volunteer_interests, dependent: :destroy | ||
# has_many :interests, through: :pending_volunteer_interests | ||
# belongs_to :volunteers | ||
# has_one :volunteer | ||
# | ||
# before_save :save_phone | ||
# | ||
# validates :first_name, presence: true | ||
# validates :last_name, presence: true | ||
# | ||
# def name | ||
# [first_name, last_name].join(' ') | ||
# end | ||
# | ||
# def self.resolve_fields_table | ||
# resolve_fields = {} | ||
# index = 0 | ||
# [:first_name, :last_name, :address, :city, :state, :zip, :email, :home_phone, :work_phone, :mobile_phone].each do |f| | ||
# resolve_fields[f] = index | ||
# index += 1 | ||
# end | ||
# resolve_fields | ||
# end | ||
# | ||
# private | ||
# | ||
# def save_phone | ||
# if self.phone | ||
# self.home_phone = self.phone | ||
# self.work_phone = self.phone | ||
# self.mobile_phone = self.phone | ||
# end | ||
# end | ||
# | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class PendingVolunteerInterest < ActiveRecord::Base | ||
belongs_to :pending_volunteer | ||
belongs_to :interest | ||
end | ||
# class PendingVolunteerInterest < ActiveRecord::Base | ||
# belongs_to :pending_volunteer | ||
# belongs_to :interest | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.