c a n d l a n d . n e t

Rails No Data Model

Dusty Candland | | rails, ruby

Take advantage of ActiveModel without a database backend.

class NoDataModel
  include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Naming

  def initialize(attributes = {})
    attributes.each do |name, value|
      send("#{name}=", value) if respond_to? "#{name}="
    end
  end

  def persisted?
    false
  end
end

Webmentions

These are webmentions via the IndieWeb and webmention.io. Mention this post from your site: