mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-17 21:29:13 +00:00
Cache other pages that users will frequent
This commit is contained in:
@@ -6,6 +6,8 @@ class Match < ActiveRecord::Base
|
|||||||
|
|
||||||
after_save do
|
after_save do
|
||||||
if self.finished == 1 && self.winner_id != nil
|
if self.finished == 1 && self.winner_id != nil
|
||||||
|
wrestler1.touch
|
||||||
|
wrestler2.touch
|
||||||
advance_wrestlers
|
advance_wrestlers
|
||||||
calcSchoolPoints
|
calcSchoolPoints
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class Wrestler < ActiveRecord::Base
|
class Wrestler < ActiveRecord::Base
|
||||||
belongs_to :school
|
belongs_to :school, touch: true
|
||||||
belongs_to :weight
|
belongs_to :weight, touch: true
|
||||||
has_one :tournament, through: :weight
|
has_one :tournament, through: :weight
|
||||||
has_many :matches, through: :weight
|
has_many :matches, through: :weight
|
||||||
has_many :deductedPoints, class_name: "Teampointadjust"
|
has_many :deductedPoints, class_name: "Teampointadjust"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% cache ["schools", @school] do %>
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}",:class=>"btn btn-default" %>
|
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}",:class=>"btn btn-default" %>
|
||||||
<% if tournament_permissions(@school.tournament) %>
|
<% if tournament_permissions(@school.tournament) %>
|
||||||
@@ -74,3 +75,4 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<% end %>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<% cache ["wrestlers", @wrestler] do %>
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
|
|
||||||
<%= link_to "Back to #{@school.name}", "/schools/#{@school.id}", :class=>"btn btn-default" %>
|
<%= link_to "Back to #{@school.name}", "/schools/#{@school.id}", :class=>"btn btn-default" %>
|
||||||
@@ -36,3 +37,4 @@
|
|||||||
<% @wrestler.deductedPoints.each do |w| %>
|
<% @wrestler.deductedPoints.each do |w| %>
|
||||||
<div> Deducted points: <%= w.points %></div>
|
<div> Deducted points: <%= w.points %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
Reference in New Issue
Block a user