diff --git a/app/models/learning_hour.rb b/app/models/learning_hour.rb index a3405354c1..e22242693f 100644 --- a/app/models/learning_hour.rb +++ b/app/models/learning_hour.rb @@ -52,7 +52,6 @@ def user_org_learning_topic_enable? # id :bigint not null, primary key # duration_hours :integer not null # duration_minutes :integer not null -# learning_type :integer default(5) # name :string not null # occurred_at :datetime not null # created_at :datetime not null diff --git a/app/policies/learning_hour_policy.rb b/app/policies/learning_hour_policy.rb index 8a25d9255b..471627bcd8 100644 --- a/app/policies/learning_hour_policy.rb +++ b/app/policies/learning_hour_policy.rb @@ -4,7 +4,7 @@ def index? end def show? - record.user_id == @user.id + @user.casa_admin? || @user.supervisor? || record.user_id == @user.id end def new? diff --git a/app/views/learning_hours/_supervisor_admin_learning_hours.html.erb b/app/views/learning_hours/_supervisor_admin_learning_hours.html.erb index f5391decdb..7fb843ed6a 100644 --- a/app/views/learning_hours/_supervisor_admin_learning_hours.html.erb +++ b/app/views/learning_hours/_supervisor_admin_learning_hours.html.erb @@ -25,7 +25,7 @@ <% @learning_hours.each do |learning_hour| %> - <%= link_to(learning_hour.display_name, volunteer_path(learning_hour.user_id)) %> + <%= link_to(learning_hour.display_name, learning_hour_path(learning_hour.user_id)) %> <%= format_time(learning_hour.total_time_spent) %> <% end %> diff --git a/app/views/learning_hours/index.html.erb b/app/views/learning_hours/index.html.erb index 3ba5ba2b3f..55dba96ad6 100644 --- a/app/views/learning_hours/index.html.erb +++ b/app/views/learning_hours/index.html.erb @@ -1,5 +1,5 @@ <% if current_user.volunteer? %> <%= render "volunteer_learning_hours", learning_hours: @learning_hours %> <% else %> - <%= render "supervisor_admin_learning_hours" %> + <%= render "supervisor_admin_learning_hours", learning_hours: @learning_hours %> <% end %> diff --git a/db/schema.rb b/db/schema.rb index 53af7a751b..6f959d77a4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -395,7 +395,6 @@ create_table "learning_hours", force: :cascade do |t| t.bigint "user_id", null: false - t.integer "learning_type", default: 5 t.string "name", null: false t.integer "duration_minutes", null: false t.integer "duration_hours", null: false