Permalink
Browse files

Prepare dummy application for integration specs

  • Loading branch information...
1 parent c69e08d commit 9f484814e3915bd0a884ae943db156ff867977e8 @LTe committed Oct 7, 2012
@@ -0,0 +1,4 @@
+class User < ActiveRecord::Base
+ attr_accessible :email
+ acts_as_messageable
+end
@@ -0,0 +1,24 @@
+class CreateMessagesTable < ActiveRecord::Migration
+ def self.up
+ create_table :messages do |t|
+ t.string :topic
+ t.text :body
+ t.references :received_messageable, :polymorphic => true
+ t.references :sent_messageable, :polymorphic => true
+ t.boolean :opened, :default => false
+ t.boolean :recipient_delete, :default => false
+ t.boolean :sender_delete, :default => false
+ t.timestamps
+
+ # ancestry
+ t.string :ancestry
+ end
+
+ add_index :messages, [:sent_messageable_id, :received_messageable_id], :name => "acts_as_messageable_ids"
+ add_index :messages, :ancestry
+ end
+
+ def self.down
+ drop_table :messages
+ end
+end
@@ -0,0 +1,11 @@
+class AddRecipientPermanentDeleteAndSenderPermanentDeleteToMessages < ActiveRecord::Migration
+ def self.up
+ add_column :messages, :recipient_permanent_delete, :boolean, :default => false
+ add_column :messages, :sender_permanent_delete, :boolean, :default => false
+ end
+
+ def self.down
+ remove_column :messages, :recipient_permanent_delete
+ remove_column :messages, :sender_permanent_delete
+ end
+end
@@ -0,0 +1,9 @@
+class CreateUsers < ActiveRecord::Migration
+ def change
+ create_table :users do |t|
+ t.string :email
+
+ t.timestamps
+ end
+ end
+end
View
@@ -0,0 +1,42 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20121007113411) do
+
+ create_table "messages", :force => true do |t|
+ t.string "topic"
+ t.text "body"
+ t.integer "received_messageable_id"
+ t.string "received_messageable_type"
+ t.integer "sent_messageable_id"
+ t.string "sent_messageable_type"
+ t.boolean "opened", :default => false
+ t.boolean "recipient_delete", :default => false
+ t.boolean "sender_delete", :default => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "ancestry"
+ t.boolean "recipient_permanent_delete", :default => false
+ t.boolean "sender_permanent_delete", :default => false
+ end
+
+ add_index "messages", ["ancestry"], :name => "index_messages_on_ancestry"
+ add_index "messages", ["sent_messageable_id", "received_messageable_id"], :name => "acts_as_messageable_ids"
+
+ create_table "users", :force => true do |t|
+ t.string "email"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+end

0 comments on commit 9f48481

Please sign in to comment.