Skip to content

Commit

Permalink
improved optimization migrations; moved status flag near temperature …
Browse files Browse the repository at this point in the history
…links
  • Loading branch information
cristi committed Jul 5, 2010
1 parent bfa7ca2 commit 6ac21f0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/controllers/brand_results_controller.rb
Expand Up @@ -8,7 +8,7 @@ def index

@brand_results = @search.paginate(
:page => params[:page],
:include => :result,
:include => [:brand, :result],
:order => "result_created_at DESC")
end

Expand Down
4 changes: 3 additions & 1 deletion app/stylesheets/partials/_results.sass
Expand Up @@ -29,10 +29,12 @@ div
:float right
a
:text-decoration none
&.status
:float right
.body
+general_font
:margin-bottom 5px
.status, .result_link
.view_links, .result_link
:font-size 11px
:margin-bottom 5px
&.read
Expand Down
5 changes: 3 additions & 2 deletions app/views/brand_results/_brand_result.html.haml
Expand Up @@ -6,12 +6,13 @@
= brand_result.state_links.join(" | ")
%div.temperature_links
= "[ #{brand_result.temperature_links.join(" | ")} ]"
%div.status
= brand_result.status
%div.body
= auto_link(sanitize(brand_result.result.body), :urls, :html => { :target => '_blank'})
%div.result_link
= brand_result.result_link
%div.status
%div.view_links
= brand_result.result.created_at.strftime("%I:%M%p")
= brand_result.status
= brand_result.view_links.join(" | ")

5 changes: 3 additions & 2 deletions app/views/brand_results/show.html.haml
Expand Up @@ -9,13 +9,14 @@
= brand_result.state_links.join(" | ")
%div.temperature_links
= "[ #{brand_result.temperature_links.join(" | ")} ]"
%div.status
= brand_result.status
%div.body
= auto_link(sanitize(brand_result.result.body), :urls, :html => { :target => '_blank'})
%div.result_link
= brand_result.result_link
%div.status
%div.view_links
= brand_result.result.created_at.strftime("%I:%M%p")
= brand_result.status

%div.comments
- @comments.each do |comment|
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20100705074120_add_brand_result_to_team.rb
Expand Up @@ -6,7 +6,7 @@ def self.up
BrandResult.reset_column_information

Brand.all.each do |b|
b.brand_results.update_all("team_id" => b.team)
b.brand_results.update_all("team_id" => b.team_id)
end
end

Expand Down
Expand Up @@ -5,8 +5,10 @@ def self.up

BrandResult.reset_column_information

BrandResult.all.each do |br|
br.update_attribute(:result_created_at, br.result.created_at)
BrandResult.find_in_batches(:batch_size => 200) do |batch|
batch.each do |br|
br.update_attribute(:result_created_at, br.result.created_at)
end
end
end

Expand Down

0 comments on commit 6ac21f0

Please sign in to comment.