Complete refactoring of messaging module. From now messages are saved only once and send afterwards via a the 'send_emails'-rake-task.
This commit is contained in:
parent
6ce6c2c75a
commit
e8d55e50c0
30 changed files with 220 additions and 349 deletions
20
db/migrate/20090115123421_refactor_messaging.rb
Normal file
20
db/migrate/20090115123421_refactor_messaging.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class RefactorMessaging < ActiveRecord::Migration
|
||||
def self.up
|
||||
|
||||
drop_table :messages
|
||||
|
||||
create_table :messages do |t|
|
||||
t.references :sender
|
||||
t.text :recipients_ids
|
||||
t.string :subject, :null => false
|
||||
t.text :body
|
||||
t.integer :email_state, :default => 0, :null => false
|
||||
t.boolean :private, :default => false
|
||||
t.datetime :created_at
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def self.down
|
||||
end
|
||||
end
|
||||
18
db/schema.rb
18
db/schema.rb
|
|
@ -9,7 +9,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20090113111624) do
|
||||
ActiveRecord::Schema.define(:version => 20090114101610) do
|
||||
|
||||
create_table "article_categories", :force => true do |t|
|
||||
t.string "name", :default => "", :null => false
|
||||
|
|
@ -184,18 +184,14 @@ ActiveRecord::Schema.define(:version => 20090113111624) do
|
|||
|
||||
create_table "messages", :force => true do |t|
|
||||
t.integer "sender_id"
|
||||
t.integer "recipient_id", :default => 0, :null => false
|
||||
t.string "recipients", :default => "", :null => false
|
||||
t.string "subject", :default => "", :null => false
|
||||
t.text "body", :null => false
|
||||
t.boolean "read", :default => false, :null => false
|
||||
t.integer "email_state", :default => 0, :null => false
|
||||
t.datetime "created_on", :null => false
|
||||
t.text "recipients_ids", :null => false
|
||||
t.string "subject", :null => false
|
||||
t.text "body"
|
||||
t.integer "email_state", :default => 0, :null => false
|
||||
t.boolean "private", :default => false
|
||||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
add_index "messages", ["recipient_id"], :name => "index_messages_on_recipient_id"
|
||||
add_index "messages", ["sender_id"], :name => "index_messages_on_sender_id"
|
||||
|
||||
create_table "order_article_results", :force => true do |t|
|
||||
t.integer "order_id", :default => 0, :null => false
|
||||
t.string "name", :default => "", :null => false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue