diff --git a/app/controllers/admin/academic_advisings_controller.rb b/app/controllers/admin/academic_advisings_controller.rb index 7f52464..2d4d81d 100644 --- a/app/controllers/admin/academic_advisings_controller.rb +++ b/app/controllers/admin/academic_advisings_controller.rb @@ -177,7 +177,7 @@ class Admin::AcademicAdvisingsController < OrbitMemberController end def get_settings - @academic_advising_types = AdvisingType.all + @advising_types = AdvisingType.all end def set_plugin diff --git a/app/helpers/admin/academic_advisings_helper.rb b/app/helpers/admin/academic_advisings_helper.rb index 98f0d8c..933e38f 100644 --- a/app/helpers/admin/academic_advisings_helper.rb +++ b/app/helpers/admin/academic_advisings_helper.rb @@ -97,7 +97,7 @@ module Admin::AcademicAdvisingsHelper (year_start..year_end).each do |year| # d1 = DateTime.new(year,1,1,0,0) # d2 = DateTime.new(year,12,31,23,59) - t = jl.academic_advisings.where(:year => year.to_s, :member_profile_id.in => mps).count rescue 0 + t = jl.advisings.where(:year => year.to_s, :member_profile_id.in => mps).count rescue 0 data["data"][year.to_s] = t end finaldata << data @@ -108,7 +108,7 @@ module Admin::AcademicAdvisingsHelper # d2 = DateTime.new(year,12,31,23,59) case type when "category" - t = Advising.where(:year => year, :member_profile_id.in => mps, :academic_advising_type_id => nil).count rescue 0 + t = Advising.where(:year => year, :member_profile_id.in => mps, :advising_type_id => nil).count rescue 0 end data["data"][year.to_s] = t diff --git a/app/models/advising.rb b/app/models/advising.rb index 48a1b3b..4d7901f 100644 --- a/app/models/advising.rb +++ b/app/models/advising.rb @@ -4,7 +4,7 @@ class Advising include OrbitModel::Status include Slug - belongs_to :academic_advising_type + belongs_to :advising_type belongs_to :member_profile field :year, type: Integer diff --git a/app/views/admin/academic_advisings/_form.html.erb b/app/views/admin/academic_advisings/_form.html.erb index cc67967..309d660 100644 --- a/app/views/admin/academic_advisings/_form.html.erb +++ b/app/views/admin/academic_advisings/_form.html.erb @@ -118,7 +118,7 @@