@@ -69,30 +69,30 @@ class Course < ActiveRecord::Base
6969 end
7070
7171 def course_as_json
72- as_json ( only : %i[
73- name
74- hide_after
75- hidden
76- cache_version
77- spreadsheet_key
78- hidden_if_registered_after
79- refreshed_at
80- locked_exercise_points_visible
81- description
82- paste_visibility
83- formal_name
84- certificate_downloadable
85- certificate_unlock_spec
86- organization_id
87- disabled_status
88- title
89- descrpition
90- material_url
91- course_template_id
92- hide_submission_results
93- external_scoreboard_url
94- ] ,
95- methods : :organization_slug )
72+ {
73+ name : name ,
74+ hide_after : hide_after ,
75+ hidden : hidden ,
76+ cache_version : cached_version ,
77+ spreadsheet_key : spreadsheet_key ,
78+ hidden_if_registered_after : hidden_if_registered_after ,
79+ refreshed_at : refreshed_at ,
80+ locked_exercise_points_visible : locked_exercise_points_visible ,
81+ description : description ,
82+ paste_visibility : paste_visibility ,
83+ formal_name : formal_name ,
84+ certificate_downloadable : certificate_downloadable ,
85+ certificate_unlock_spec : certificate_unlock_spec ,
86+ organization_id : organization_id ,
87+ disabled_status : disabled_status ,
88+ title : title ,
89+ descrpition : descripition ,
90+ material_url : material_url ,
91+ course_template_id : course_template_id ,
92+ hide_submission_results : hide_submission_results ,
93+ external_scoreboard_url : external_scoreboard_url ,
94+ organization_slug : organization_slug ,
95+ }
9696 end
9797
9898 swagger_schema :CourseLinks do
@@ -143,8 +143,8 @@ def links_as_json(view_context)
143143 validates :description , length : { maximum : 512 }
144144 validate :check_name_length
145145
146- # If made from template, make sure cache_version is not out of sync.
147- before_save :set_cache_version
146+ # If made from template, make sure cached_version is not out of sync.
147+ before_save :set_cached_version
148148 before_validation :save_template
149149 validates :source_url , presence : true
150150 # validates :custom_points_url,
@@ -207,7 +207,7 @@ def self.new_from_template(course_template)
207207 title : course_template . title ,
208208 description : course_template . description ,
209209 material_url : course_template . material_url ,
210- cache_version : course_template . cache_version ,
210+ cached_version : course_template . cached_version ,
211211 course_template : course_template )
212212 end
213213
@@ -285,7 +285,7 @@ def self.cache_root
285285 "#{ FileStore . root } /course"
286286 end
287287
288- delegate :increment_cache_version , to : :course_template_obj
288+ delegate :increment_cached_version , to : :course_template_obj
289289
290290 delegate :cache_path , to : :course_template_obj
291291
@@ -532,8 +532,8 @@ def parsed_external_scoreboard_url(organization, course, user)
532532
533533 private
534534
535- def set_cache_version
536- self . cache_version = course_template_obj . cache_version
535+ def set_cached_version
536+ self . cached_version = course_template_obj . cached_version
537537 end
538538
539539 def save_template
0 commit comments