鉴于以下电子邮件地址 - someone@example.com - 如何使用javascript从地址中提取某人?
谢谢.
我有一个名为的班级Post
:
class Post < ActiveRecord::Base
end
Run Code Online (Sandbox Code Playgroud)
我有一个名为Question
继承自的类Post
:
class Question < Post
end
Run Code Online (Sandbox Code Playgroud)
我有一个名为Answer
继承自'Post'的类:
class Answer < Post
end
Run Code Online (Sandbox Code Playgroud)
在Post
,我有一个名为列的列post_type_id
,其类型是Integer
.
如何使用STI和特定列名称和类型从Post继承?0
手段Question
和1
手段Answer
.(0和1是post_type_id
帖子表中的值)
我使用devise_openid_authenticatable来支持带有rails3 beta4设计的OpenID.但是当我运行rake db:migrate时,它会发生[undefined method`applied_schema'] error.like this:
== DeviseCreateUsers: migrating ==============================================
-- create_table(:users)
rake aborted!
An error has occurred, all later migrations canceled:
undefined method `apply_schema' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x1036ffb40>
Run Code Online (Sandbox Code Playgroud)
config.middleware.use Rack::OpenID
在配置/ application.rb中
有人能帮我一把吗?谢谢!