commit
264c6679e0
@ -0,0 +1,4 @@
|
|||||||
|
class Forward < ActiveRecord::Base
|
||||||
|
validates_presence_of :from_id, :from_type, :to_id, :to_type
|
||||||
|
belongs_to :from, :polymorphic => true
|
||||||
|
end
|
@ -0,0 +1,15 @@
|
|||||||
|
class CreateForwards < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :forwards do|t|
|
||||||
|
t.integer :from_id
|
||||||
|
t.string :from_type
|
||||||
|
t.integer :to_id
|
||||||
|
t.string :to_type
|
||||||
|
t.timestamp :created_at
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :forwards
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue