Ruby on rails Rails-名称空间迁移

Ruby on rails Rails-名称空间迁移,ruby-on-rails,ruby,migration,Ruby On Rails,Ruby,Migration,我有以下模型和迁移: class Content::Panels::Iframe < Content::Panel ## Associations ## belongs_to :panel_holder, polymorphic: true ## Validations ## validates :uri, presence: true ## Methods ## def self.plural_name 'iframe_index' end end

我有以下模型和迁移:

class Content::Panels::Iframe < Content::Panel
  ## Associations ##
  belongs_to :panel_holder, polymorphic: true

  ## Validations ##
  validates :uri, presence: true

  ## Methods ##
  def self.plural_name
    'iframe_index'
  end
end

class AddHeightToIframes < ActiveRecord::Migration[5.1]
  def change
    add_column :iframes, :height, :integer, after: :headline
  end
end
将表格标题改为“内容面板”或“框架”,但单独或一起尝试时,这两种方法都不起作用


我做错了什么?提前感谢

当表名为
content\u panels\u iframes
时,迁移应为:

add_column :content_panels_iframes, :height, :integer, after: :headline

当表名为
content\u panels\u iframes
时,迁移应为:

add_column :content_panels_iframes, :height, :integer, after: :headline

存储这些记录的表的名称是什么?它们都存储在内容面板下。。。我真蠢,没有检查-谢谢高亮显示这并不奇怪-您的模型继承自
Content::Panel
。使用单表继承时,基本模型类通常与表名匹配。存储这些记录的表名是什么?它们都存储在内容面板下。。。我真蠢,没有检查-谢谢高亮显示这并不奇怪-您的模型继承自
Content::Panel
。使用单表继承时,基本模型类通常与表名匹配。