Displaying 1 result from an estimated 1 matches for "as_relation_superclass".
2012 Apr 05
0
Polymorphism, acts_as_relation gem and nested attributes
...epts_nested_attributes_for :emails, allow_destroy: true
end
class User < ActiveRecord::Base
acts_as :detail
validates_presence_of :username, :password
end
Migration code:
class CreateInfo < ActiveRecord::Migration
def change
create_table :details, :as_relation_superclass => true do |t|
t.timestamps
end
end
end
class CreateEmails < ActiveRecord::Migration
def change
create_table :emails do |t|
t.string :address
t.string :address_type
t.string :detail_id
t.timestamps...