Skip to content

Commit

Permalink
use info_updated_at instead of updated_at
Browse files Browse the repository at this point in the history
  • Loading branch information
sashazykov committed Jul 17, 2014
1 parent 3b211f5 commit a3d83ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions db/migrate/20140717085945_add_info_updated_at_to_projects.rb
@@ -0,0 +1,5 @@
class AddInfoUpdatedAtToProjects < ActiveRecord::Migration
def change
add_column :projects, :info_updated_at, :timestamp
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20140620124628) do
ActiveRecord::Schema.define(version: 20140717085945) do

create_table "collaborators", force: true do |t|
t.integer "project_id"
Expand Down Expand Up @@ -52,6 +52,7 @@
t.string "github_id"
t.string "host", default: "github"
t.boolean "hold_tips", default: false
t.datetime "info_updated_at"
end

add_index "projects", ["full_name"], name: "index_projects_on_full_name", unique: true
Expand Down
4 changes: 2 additions & 2 deletions lib/bitcoin_tipper.rb
Expand Up @@ -15,10 +15,10 @@ def self.work withdraw = true
end

Rails.logger.info "Updating projects info..."
Project.order(:updated_at => :desc).last(20).each do |project|
Project.order(:info_updated_at => :desc).last(20).each do |project|
Rails.logger.info " Project #{project.id} #{project.full_name}"
project.update_info
project.touch
project.touch(:info_updated_at)
end

if withdraw
Expand Down

0 comments on commit a3d83ad

Please sign in to comment.