Skip to content

Commit

Permalink
volunteer's learning hours page (#5499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nwabor authored Feb 7, 2024
1 parent ad5bf86 commit 11bf33d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/models/learning_hour.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/policies/learning_hour_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<tbody>
<% @learning_hours.each do |learning_hour| %>
<tr>
<td><%= link_to(learning_hour.display_name, volunteer_path(learning_hour.user_id)) %></td>
<td><%= link_to(learning_hour.display_name, learning_hour_path(learning_hour.user_id)) %></td>
<td><%= format_time(learning_hour.total_time_spent) %></td>
</tr>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/learning_hours/index.html.erb
Original file line number Diff line number Diff line change
@@ -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 %>
1 change: 0 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 11bf33d

Please sign in to comment.