суббота, ноября 11, 2006

Sendmail vs smtp

Когда стоит вопрос каким образом отсылать email, знайте что sendmail гораздо быстрее SMTP.

SMTP:
Sending Mail to user (25.22760)
Sending Mail to internal (31.11207)
Sending Mail notification (20.70688)

Sendmail:
Sending Mail to user (0.16841)
Sending Mail to internal (0.28479)
Sending Mail notification (0.24701)

Source

среда, ноября 08, 2006

ActiveRecord added support for nil and Array in :conditions

Nice feature added to rails several days ago

Support nil and Array in :conditions => { attr => value } hashes. #6548 [Assaf, Jeremy Kemper]
find(:all, :conditions => { :topic_id => [1, 2, 3], :last_read => nil }


So for Todo.find(:all, :conditions => { :id => [1,2,3] })
will be generated following query
SELECT * FROM todos WHERE (todos.`id` IN (1,2,3))

And Todo.find(:all, :conditions => { :description => nil }) will use
SELECT * FROM todos WHERE (todos.`description` IS NULL)