Hmmmm makes good sense. I will try it out and report.
Thank you, Franz :)

On 8 April 2010 00:35, Franz Strebel <[email protected]> wrote:

> Your script seems to be in the body of the Blog model.
>
> For what you're trying to do, I suggest that you create a class
> method in Blog to publish entries e.g.
>
> def self.publish_entries
>  # your code goes here
> end
>
> which you can then invoke with Blog.publish_entries
>
> Also, the way you are trying to do it is database intensive.
> The initial search to get new entries is a hit on the db.  Then
> each call to save will hit the db again.
>
> I recommend looking up update_all in the Rails API
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to