parm530
6/11/2019 - 4:21 PM

Table-less Model

How to implement a table-less model in Rails

  • Need a model without database interaction?
    • Just remove the inheritance of < ActiveRecord::Base
    • include ActiveModel::Model within the class to be able to use validation methods
  • Make sure to declare attr_accessor's and use them in the initialize() method!