Here are my rabl views:
Students /show.json.rabl
object @student cache @student attribute :name, :gender, :age node :school do |student| partial("shared/school", :object => student.school) end
general /_school.json.rabl
object @school cache @school attributes :id, :name
student.rb:
class Student < ActiveRecord::Base belongs_to :school, :touch => true end
school.rb
class School < ActiveRecord::Base has_many :students end
Therefore, when I update a student, the cache becomes invalid as expected. The problem is that when I update the school, the students do not receive the updated school attributes. I would have thought that the @school cache would partially become invalid when I update the school model, but that doesn't seem to be the case.
EDIT: Added touch on student to cancel school on upgrade.
source share