Displaying 1 result from an estimated 1 matches for "createinfo".
Did you mean:
create_info
2012 Apr 05
0
Polymorphism, acts_as_relation gem and nested attributes
...Detail < ActiveRecord::Base
acts_as_superclass
has_many :emails
accepts_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 :a...