ActiveRecord::Base Without Table

前端 未结 7 1476
灰色年华
灰色年华 2020-12-01 01:40

This came up a bit ago ( rails model attributes without corresponding column in db ) but it looks like the Rails plugin mentioned is not maintained ( http://agilewebdevelopm

7条回答
  •  温柔的废话
    2020-12-01 02:12

    There is the activerecord-tableless gem. It's a gem to create tableless ActiveRecord models, so it has support for validations, associations, types. It supports Active Record 2.3, 3.0, 3.2

    The recommended way to do it in Rails 3.x (using ActiveModel) has no support for associations nor types.

提交回复
热议问题