How to create ActiveRecord tableless Model in Rails 3

后端 未结 7 2305
终归单人心
终归单人心 2020-12-30 03:05

I am trying to create a Active Record tableless Model. My user.rb looks like this

class User < ActiveRecord::Base

  class_inheritable_accessor :columns

         


        
7条回答
  •  孤独总比滥情好
    2020-12-30 03:39

    Few things:

    Firstly you are using the Rails2 approach outlined in Railscast 193 when really you should be using the Rails 3 approach, outlined in Railscast 219

    You probably don't want to inherit from ActiveRecord::Base when doing this sort of thing.

    Read Yehuda Katz's blog post on this.

提交回复
热议问题