Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add users#login index

  • Loading branch information...
commit 3dd2a3e30ac265dbf83c6daea707fe316cd7277c 1 parent 2b6cfa7
@technoweenie technoweenie authored
View
5 Rakefile
@@ -78,7 +78,10 @@ namespace :seinfeld do
desc "Update the calendar of USER"
task :update => :init do
if ENV['USER'].blank?
- Rake::Task["cron"].invoke
+ Seinfeld::User.active.paginated_each do |user|
+ feed = Seinfeld::Updater.run(user)
+ puts "#{user.login}#{' (disabled)' if user.disabled?} - #{feed.inspect}"
+ end
else
user = Seinfeld::User.find_by_login(ENV['USER'])
if user
View
9 db/migrate/20100509055024_index_user_login.rb
@@ -0,0 +1,9 @@
+class IndexUserLogin < ActiveRecord::Migration
+ def self.up
+ add_index :seinfeld_users, :login, :unique => true
+ end
+
+ def self.down
+ remove_index :seinfeld_users, :login
+ end
+end
View
3  db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20100508173240) do
+ActiveRecord::Schema.define(:version => 20100509055024) do
create_table "seinfeld_progressions", :force => true do |t|
t.date "created_at"
@@ -33,6 +33,7 @@
add_index "seinfeld_users", ["current_streak"], :name => "index_seinfeld_users_current_streak"
add_index "seinfeld_users", ["disabled"], :name => "index_seinfeld_users_on_disabled"
+ add_index "seinfeld_users", ["login"], :name => "index_seinfeld_users_on_login", :unique => true
add_index "seinfeld_users", ["longest_streak"], :name => "index_seinfeld_users_longest_streak"
end
View
1  lib/seinfeld/updater.rb
@@ -18,6 +18,7 @@ def run(today = Date.today)
@user.disabled = true
@user.save!
end
+ feed
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.