Skip to content

Instantly share code, notes, and snippets.

<!-- AddThis Button BEGIN -->
<a href="http://www.addthis.com/bookmark.php?v=250"
onmouseover="return addthis_open(this, '', '[<%= news_breakers_path %>]', '[<%= news_breaker.title -%>]');"
onmouseout="addthis_close();"
onclick="return addthis_sendto();">
<img src="http://s7.addthis.com/static/btn/sm-share-en.gif" width="83" height="16" alt="Bookmark and Share" style="border:0"/></a>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=bernsno"></script>
<!-- AddThis Button END -->
triggering start callbacks for `production'
Identity added: /Users/noah/.ssh/id_rsa (/Users/noah/.ssh/id_rsa)
* executing `production'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
Identity added: /Users/noah/.ssh/id_rsa (/Users/noah/.ssh/id_rsa)
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
triggering start callbacks for `production'
Identity added: /Users/noah/.ssh/id_rsa (/Users/noah/.ssh/id_rsa)
* executing `production'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
Identity added: /Users/noah/.ssh/id_rsa (/Users/noah/.ssh/id_rsa)
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
triggering start callbacks for `production'
Identity added: /Users/noah/.ssh/id_rsa (/Users/noah/.ssh/id_rsa)
* executing `production'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
Identity added: /Users/noah/.ssh/id_rsa (/Users/noah/.ssh/id_rsa)
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
triggering start callbacks for `production'
Identity added: /Users/noah/.ssh/id_rsa (/Users/noah/.ssh/id_rsa)
* executing `production'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
Identity added: /Users/noah/.ssh/id_rsa (/Users/noah/.ssh/id_rsa)
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
module PFR
class CareerStat < ActiveRecord::Base
tableless :columns => [[:player_id, :integer],
[:season_id, :integer],
[:stat_name_id, :integer],
[:value, :string]]
belongs_to :player
belongs_to :season
belongs_to :stat_name
$("#news_container").load(("/news_breakers:format?format=js"), function(){
$("#news_posts").accordion({autoHeight: false});
$("#news_container").jScrollPane({scrollbarWidth:5});
$(".news_breakers_box .pagination a").live("click", function(){
$('#news_container').load(this.href, function() {
$("#news_posts").accordion({autoHeight: false});
});
return false
});
});
// spread_the_fire/index.html
<div id="popup_spread_fire">
<a class="close_box" onclick="window.top.tb_remove();" href="#">close</a>
<% form_tag('/spread_the_fire', :id => 'fireForm', :class => 'remoteForm') do %>
<div class="left_form">
<p>
<%= label :email, :recipients, "To" %>
<%= text_field :email, :recipients, :class => 'required email' %>
</p>
positions = Position.all(:conditions => ["name in (?)", ["wr","rb","te"]])
players = Player.all(:conditions => ["position_id in (?)", positions.map(&:id)])
rec_td_stat_name = StatName.find_by_title("Reception Touchdowns")
rush_td_stat_name = StatName.find_by_title("Rush Touchdowns")
rrtd_stat_name = StatName.find_by_title("Rushing and Receiving Touchdowns")
players.each do |player|
seasons = player.career_seasons
seasons.each do |season|
stats = []
rec_td_stat_name = StatName.find_by_title("Reception Touchdowns")
rush_td_stat_name = StatName.find_by_title("Rush Touchdowns")
rrtd_stat_name = StatName.find_by_title("Rushing and Receiving Touchdowns")
CareerStat.find_all_by_stat_name_id(rrtd_stat_name.id).each do |career_stat|
rec_td_career_stat = CareerStat.find_by_season_id_and_player_id_and_stat_name_id(career_stat.season_id, career_stat.player_id, rec_td_stat_name.id)
rush_td_career_stat = CareerStat.find_by_season_id_and_player_id_and_stat_name_id(career_stat.season_id, career_stat.player_id, rush_td_stat_name.id)
career_stat.update_attributes!(:value => rec_td_career_stat.value.to_i + rush_td_career_stat.value.to_i)
end