forked from altrabio/CITIEsForRAILS
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
What is the exact procedure of writing the migration for inserting a class in the middle of the inheritance structure? Quick Example that follows from the Usage Guide
class BoundedBook < Book
acts_as_citier
end
class Dictionary < BoundedBook
acts_as_citier
end
class CreateBoundedBooks < ActiveRecord::Migration
def self.up
create_table :bounded_books do |t|
t.string :binder
end
drop_citier_view(Dictionary)
create_citier_view(BoundedBook)
create_citier_view(Dictionary)
/**
* SOME CODE TO POPULATE THE bounded_book TABLE
* WITH THE :binder DATA FOR EXISTING DICTIONARIES
**/
end
def self.down
drop_citier_view(BoundedBook)
drop_table :bounded_books
end
end
Whats the code I need to insert? Something like Dictionary.find_each do etc etc etc. Then create new BoundedBook objects? Please help.
Metadata
Metadata
Assignees
Labels
No labels