是否可以使用annotate (2.4.1.beta)
gem在他们翻译的模型中输出globalize3 (0.2.0)
个已翻译的属性?
如果我创建了Post
创建迁移like so
class CreatePosts < ActiveRecord::Migration
def up
create_table :posts do |t|
t.timestamps
end
Post.create_translation_table! title: :string, text: :text
end
def down
drop_table :posts
Post.drop_translation_table!
end
end
及其对应的类看起来像
class Post < ActiveRecord::Base
attr_accessible :title, :text
translates :title, :text
end
因为:title
和:text
属性不在posts
表中,而在post_translations
表中,当我运行时
$ annotate --position before
它们未包含在Post
模型的输出中:
# == Schema Information
#
# Table name: posts
#
# id :integer not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
#
class Post < ActiveRecord::Base
...
有没有办法在每次注释生成后手动输入这些属性来包含这些属性?