Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cron fixed

  • Loading branch information...
commit b80e23758a6450b7b16873688b23382d67a73746 1 parent db5b3d7
@micahbrich authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 app/models/post.rb
  2. +1 −1  lib/tasks/cron.rake
View
4 app/models/post.rb
@@ -10,7 +10,7 @@ class Post < ActiveRecord::Base
named_scope :prev_date, lambda { |p| {:conditions => ["created_at < ?", p.created_at], :limit => 1, :order => "created_at DESC"} }
named_scope :next_date, lambda { |p| {:conditions => ["created_at > ?", p.created_at], :limit => 1, :order => "created_at"} }
- attr_accessible :id, :title, :description, :url, :image, :thumb, :created_at, :updated_at, :flickr_id
+ attr_accessible :id, :title, :description, :url, :image, :thumb, :created_at, :updated_at, :flickr_id, :fetch
def self.per_page
30
@@ -24,7 +24,7 @@ def full_url
"http://www.micahrich.com/blog/posts/#{self.id}"
end
- def fetch
+ def self.fetch!
@flickr ||= Fleakr.api_key = 'fb5cf2883adb61c3978689f570542433'
@user ||= Fleakr.user('info@micahrich.com')
@photos ||= @user.sets.last.photos
View
2  lib/tasks/cron.rake
@@ -1,6 +1,6 @@
task :cron => :environment do
puts "About to fetch from Flickr!"
- if Post.fetch
+ if Post.fetch!
puts "Flickr fetched!"
else
puts "Didn't fetch! Flickr fetching error!"
Please sign in to comment.
Something went wrong with that request. Please try again.