我有一个名为products的rails表设置,并且一切正常,假设我要在创建后3周自动删除记录,如何处理代码
我的产品数据库如下
class Products < ActiveRecord::Migration
def change
create_table :products do |t|
t.text :description
t.string :price
t.string :name
t.string :contact
t.attachment :photo
t.string :slug
t.integer :user_id
t.timestamps
end
add_index :products, :user_id
end
end
Run Code Online (Sandbox Code Playgroud) 我正在设计一个简单的rails 3应用程序,并有一个post模型
t.string :author
t.string :title
t.text :description
Run Code Online (Sandbox Code Playgroud)
要实现的是,能够向订阅者发送电子邮件,感兴趣的读者将获得一个添加其电子邮件地址的表单,以便在创建帖子时向订阅者发送电子邮件,向他们显示新帖子....谢谢,也是一种新的铁轨,请说明一点