Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing compatibility with social_stream

  • Loading branch information...
commit 9a1389d4a02dfd3ab7f5c2622c3d4db9db58b7d2 1 parent 093475d
@Roendal Roendal authored
View
0  ...mmy/db/migrate/20120123185900_create_mailboxer.rb → db/migrate/20110511145103_create_mailboxer.rb 100644 → 100755
File renamed without changes
View
0  .../db/migrate/20120123185901_add_notified_object.rb → db/migrate/20110719110700_add_notified_object.rb
File renamed without changes
View
0  ...b/migrate/20120123185902_add_notification_code.rb → db/migrate/20110912163911_add_notification_code.rb
File renamed without changes
View
5 db/migrate/20111204163911_add_attachments.rb
@@ -0,0 +1,5 @@
+class AddAttachments < ActiveRecord::Migration
+ def change
+ add_column :notifications, :attachment, :string
+ end
+end
View
18 lib/generators/mailboxer/install_generator.rb
@@ -17,16 +17,16 @@ def create_initializer_file
end
def copy_migrations
- migrations = ["20110511145103_create_mailboxer.rb",
- "20110719110700_add_notified_object.rb",
- "20110912163911_add_notification_code.rb",
- "20111204163911_add_attachments.rb"]
+ migrations = [["20110511145103_create_mailboxer.rb","create_mailboxer.rb"],
+ ["20110719110700_add_notified_object.rb","add_notified_object.rb"],
+ ["20110912163911_add_notification_code.rb","add_notification_code.rb"],
+ ["20111204163911_add_attachments.rb","add_attachments.rb"]]
migrations.each do |migration|
- begin
- migration_template "db/migrate/" + migration, "db/migrate/" + migration
- rescue
- puts "Another migration is already named '" + migration + "'. Moving to next one."
- end
+ # begin
+ migration_template "../../../../db/migrate/" + migration[0], "db/migrate/" + migration[1]
+ # rescue
+ # puts "Another migration is already named '" + migration + "'. Moving to next one."
+ # end
end
end
end
View
3  mailboxer.gemspec
@@ -32,9 +32,6 @@ Gem::Specification.new do |s|
s.add_development_dependency('forgery', '>= 0.3.6')
# Integration testing
s.add_development_dependency('capybara', '>= 0.3.9')
- # Searching
- s.add_development_dependency('sunspot_rails', '>= 1.3.0')
- s.add_development_dependency('sunspot_solr', '>= 1.3.0')
# Testing database
s.add_development_dependency('sqlite3-ruby') unless RUBY_PLATFORM == 'java'
s.add_development_dependency('jdbc-sqlite3') if RUBY_PLATFORM == 'java'
View
1  spec/dummy/Gemfile
@@ -2,6 +2,7 @@ source 'http://rubygems.org'
gem 'rails', '~> 3.0.0'
gem 'mailboxer', :path => '../../'
+gem 'factory_girl'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
View
2  spec/dummy/config/initializers/mailboxer.rb
@@ -14,4 +14,4 @@
#Supported enignes: [:solr,:sphinx]
config.search_enabled = false
config.search_engine = :solr
-end
+end
View
13 spec/dummy/db/migrate/20120123185903_add_attachments.rb
@@ -1,13 +0,0 @@
-class AddAttachments < ActiveRecord::Migration
- def self.up
- change_table :notifications do |t|
- t.string :attachment, :default => nil
- end
- end
-
- def self.down
- change_table :notifications do |t|
- t.remove :attachment
- end
- end
-end
View
61 spec/dummy/db/migrate/20120305103200_create_mailboxer.rb
@@ -0,0 +1,61 @@
+class CreateMailboxer < ActiveRecord::Migration
+ def self.up
+ #Tables
+ #Conversations
+ create_table :conversations do |t|
+ t.column :subject, :string, :default => ""
+ t.column :created_at, :datetime, :null => false
+ t.column :updated_at, :datetime, :null => false
+ end
+ #Receipts
+ create_table :receipts do |t|
+ t.references :receiver, :polymorphic => true
+ t.column :notification_id, :integer, :null => false
+ t.column :read, :boolean, :default => false
+ t.column :trashed, :boolean, :default => false
+ t.column :deleted, :boolean, :default => false
+ t.column :mailbox_type, :string, :limit => 25
+ t.column :created_at, :datetime, :null => false
+ t.column :updated_at, :datetime, :null => false
+ end
+ #Notifications and Messages
+ create_table :notifications do |t|
+ t.column :type, :string
+ t.column :body, :text
+ t.column :subject, :string, :default => ""
+ t.references :sender, :polymorphic => true
+ t.references :object, :polymorphic => true
+ t.column :conversation_id, :integer
+ t.column :draft, :boolean, :default => false
+ t.column :updated_at, :datetime, :null => false
+ t.column :created_at, :datetime, :null => false
+ end
+
+
+ #Indexes
+ #Conversations
+ #Receipts
+ add_index "receipts","notification_id"
+
+ #Messages
+ add_index "notifications","conversation_id"
+
+ #Foreign keys
+ #Conversations
+ #Receipts
+ add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id"
+ #Messages
+ add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id"
+ end
+
+ def self.down
+ #Tables
+ remove_foreign_key "receipts", :name => "receipts_on_notification_id"
+ remove_foreign_key "notifications", :name => "notifications_on_conversation_id"
+
+ #Indexes
+ drop_table :receipts
+ drop_table :conversations
+ drop_table :notifications
+ end
+end
View
17 spec/dummy/db/migrate/20120305103201_add_notified_object.rb
@@ -0,0 +1,17 @@
+class AddNotifiedObject < ActiveRecord::Migration
+ def self.up
+ change_table :notifications do |t|
+ t.references :notified_object, :polymorphic => true
+ t.remove :object_id
+ t.remove :object_type
+ end
+ end
+
+ def self.down
+ change_table :notifications do |t|
+ t.remove :notified_object_id
+ t.remove :notified_object_type
+ t.references :object, :polymorphic => true
+ end
+ end
+end
View
13 spec/dummy/db/migrate/20120305103202_add_notification_code.rb
@@ -0,0 +1,13 @@
+class AddNotificationCode < ActiveRecord::Migration
+ def self.up
+ change_table :notifications do |t|
+ t.string :notification_code, :default => nil
+ end
+ end
+
+ def self.down
+ change_table :notifications do |t|
+ t.remove :notification_code
+ end
+ end
+end
View
5 spec/dummy/db/migrate/20120305103203_add_attachments.rb
@@ -0,0 +1,5 @@
+class AddAttachments < ActiveRecord::Migration
+ def change
+ add_column :notifications, :attachment, :string
+ end
+end
View
74 spec/dummy/db/schema.rb
@@ -0,0 +1,74 @@
+# 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 => 20120305103203) do
+
+ create_table "conversations", :force => true do |t|
+ t.string "subject", :default => ""
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "cylons", :force => true do |t|
+ t.string "name"
+ t.string "email"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "ducks", :force => true do |t|
+ t.string "name"
+ t.string "email"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "notifications", :force => true do |t|
+ t.string "type"
+ t.text "body"
+ t.string "subject", :default => ""
+ t.integer "sender_id"
+ t.string "sender_type"
+ t.integer "conversation_id"
+ t.boolean "draft", :default => false
+ t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.integer "notified_object_id"
+ t.string "notified_object_type"
+ t.string "notification_code"
+ t.string "attachment"
+ end
+
+ add_index "notifications", ["conversation_id"], :name => "index_notifications_on_conversation_id"
+
+ create_table "receipts", :force => true do |t|
+ t.integer "receiver_id"
+ t.string "receiver_type"
+ t.integer "notification_id", :null => false
+ t.boolean "read", :default => false
+ t.boolean "trashed", :default => false
+ t.boolean "deleted", :default => false
+ t.string "mailbox_type", :limit => 25
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "receipts", ["notification_id"], :name => "index_receipts_on_notification_id"
+
+ create_table "users", :force => true do |t|
+ t.string "name"
+ t.string "email"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.