<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://bridgetownrb.com/" version="2.2.2">Bridgetown</generator><link href="https://peterboling.com/feed/anonymous_active_record.xml" rel="self" type="application/atom+xml" /><link href="https://peterboling.com/" rel="alternate" type="text/html" /><updated>2026-11-15T23:03:36+00:00</updated><id>https://peterboling.com/feed/anonymous_active_record.xml</id><title type="html">Peter Boling | Anonymous_active_record</title><subtitle>Yet Another Paradigm by Peter Boling, featuring technical blog posts about Ruby, JavaScript, TypeScript, Go, Python, DevOps, and various open source projects. Ramblings, mumblings, cv/resume, technical blog, and documentation for many popular, and unpopular, RubyGems and other FLOSS projects, including oauth2, omniauth-identity, sanitize_email, debug_logging, flag_shih_tzu, gem_bench, etc. Semi-lifely state-of-the-petris updates.</subtitle><author><name>Peter Boling</name><email>floss@galtzo.com</email></author><entry><title type="html">anonymous_active_record v1.0.9 released!</title><link href="https://peterboling.com/anonymous_active_record/anonymous_active_record-v1.0.9-released!/" rel="alternate" type="text/html" title="anonymous_active_record v1.0.9 released!" /><published>2024-09-18T10:55:41+00:00</published><updated>2024-09-18T10:55:41+00:00</updated><id>https://peterboling.com/anonymous_active_record/anonymous_active_record-v1.0.9-released!/</id><content type="html" xml:base="https://peterboling.com/anonymous_active_record/anonymous_active_record-v1.0.9-released!/">&lt;h2 id=&quot;109-2024sep18&quot;&gt;[1.0.9] 2024.SEP.18&lt;/h2&gt;
&lt;p&gt;COVERAGE: 100.00% – 82/82 lines in 4 files
BRANCH COVERAGE:  94.44% – 17/18 branches in 4 files
59.09% documented&lt;/p&gt;
&lt;h3 id=&quot;added&quot;&gt;Added&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;100% test coverage&lt;/li&gt;
  &lt;li&gt;Expanded CI test matrix to cover all supported &amp;amp; unsupported Rubies
    &lt;ul&gt;
      &lt;li&gt;Ruby 2.4&lt;/li&gt;
      &lt;li&gt;Ruby 2.5&lt;/li&gt;
      &lt;li&gt;Ruby 2.6&lt;/li&gt;
      &lt;li&gt;Ruby 2.7&lt;/li&gt;
      &lt;li&gt;Ruby 3.0&lt;/li&gt;
      &lt;li&gt;Ruby 3.1&lt;/li&gt;
      &lt;li&gt;Ruby 3.2&lt;/li&gt;
      &lt;li&gt;Ruby 3.3&lt;/li&gt;
      &lt;li&gt;ruby-head&lt;/li&gt;
      &lt;li&gt;truffleruby-head&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Improved Documentation&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;kettle-soup-cover&lt;/code&gt; for test coverage enforcement&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;kettle-soup-cover&lt;/code&gt; for test coverage enforcement&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;bin/checksums&lt;/code&gt; for release checksums&lt;/li&gt;
  &lt;li&gt;Checksums for release
    &lt;ul&gt;
      &lt;li&gt;SHA-256&lt;/li&gt;
      &lt;li&gt;SHA-512&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Signed releases&lt;/li&gt;
  &lt;li&gt;Add CHANGELOG.md&lt;/li&gt;
  &lt;li&gt;Add SECURITY.md (Security policy)&lt;/li&gt;
&lt;/ul&gt;</content><category term="release" /><category term="anonymous_active_record" /><category term="v1.0.9" /></entry><entry><title type="html">Introducing anonymous_active_record</title><link href="https://peterboling.com/anonymous_active_record/introducing-anonymous_active_record/" rel="alternate" type="text/html" title="Introducing anonymous_active_record" /><published>2018-01-04T21:41:16+00:00</published><updated>2018-01-04T21:41:16+00:00</updated><id>https://peterboling.com/anonymous_active_record/introducing-anonymous_active_record/</id><content type="html" xml:base="https://peterboling.com/anonymous_active_record/introducing-anonymous_active_record/">&lt;h2 id=&quot;activerecord-without-a-database&quot;&gt;ActiveRecord Without a Database?&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/pboling/anonymous_active_record&quot;&gt;&lt;img src=&quot;https://img.shields.io/gem/rt/anonymous_active_record.svg&quot; alt=&quot;Total Downloads&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://github.com/pboling/anonymous_active_record&quot;&gt;&lt;img src=&quot;https://img.shields.io/gem/rd/anonymous_active_record.svg&quot; alt=&quot;Downloads Today&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://codeclimate.com/github/pboling/anonymous_active_record&quot;&gt;&lt;img src=&quot;https://img.shields.io/codeclimate/github/pboling/anonymous_active_record.svg&quot; alt=&quot;Code Quality&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://github.com/pboling/anonymous_active_record/network&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/forks/pboling/anonymous_active_record.svg?style=social&quot; alt=&quot;Network&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://github.com/pboling/anonymous_active_record/stargazers&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/stars/pboling/anonymous_active_record.svg?style=social&quot; alt=&quot;Stars&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://rubygems.org/gems/anonymous_active_record&quot;&gt;&lt;img src=&quot;https://img.shields.io/gem/v/anonymous_active_record.svg&quot; alt=&quot;Version&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://travis-ci.org/pboling/anonymous_active_record&quot;&gt;&lt;img src=&quot;https://img.shields.io/travis/pboling/anonymous_active_record.svg&quot; alt=&quot;Build&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://inch-ci.org/github/pboling/anonymous_active_record&quot;&gt;&lt;img src=&quot;http://inch-ci.org/github/pboling/anonymous_active_record.svg&quot; alt=&quot;Documentation&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://depfu.com/github/pboling/anonymous_active_record?project=Bundler&quot;&gt;&lt;img src=&quot;https://badges.depfu.com/badges/96a4d507f1a61a9368655f60fa3cb70f/count.svg&quot; alt=&quot;Depfu&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://img.shields.io/gitter/room/pboling/anonymous_active_record.svg&quot;&gt;&lt;img src=&quot;https://img.shields.io/gitter/room/pboling/anonymous_active_record.svg&quot; alt=&quot;Chat&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://opensource.org/licenses/MIT&quot;&gt;&lt;img src=&quot;https://img.shields.io/badge/License-MIT-green.svg&quot; alt=&quot;License: MIT&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Replacement for broken &lt;code class=&quot;highlighter-rouge&quot;&gt;Class.new(ActiveRecord::Base)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Very useful in testing Rails apps, and even more so for testing gems without having to specify full blown models.&lt;/p&gt;

&lt;p&gt;If you prefer an exceptionally hacky alternative that could also be used for real runtime code, see my other gem &lt;a href=&quot;https://rubygems.org/gems/activerecord-tablefree&quot;&gt;activerecord-tablefree&lt;/a&gt;!&lt;/p&gt;

&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;/h2&gt;

&lt;p&gt;Add this line to your application’s Gemfile:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;anonymous_active_record&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then execute:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bundle
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or install it yourself as:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ gem install anonymous_active_record
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;usage&quot;&gt;Usage&lt;/h2&gt;

&lt;p&gt;Require the library in your &lt;code class=&quot;highlighter-rouge&quot;&gt;spec_helper&lt;/code&gt; or other test suite boot file.&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;anonymous_active_record&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Let’s say you want to write specs for a module, &lt;code class=&quot;highlighter-rouge&quot;&gt;HasBalloon&lt;/code&gt;, which provides a method &lt;code class=&quot;highlighter-rouge&quot;&gt;has_balloon?&lt;/code&gt;, and will be mixed into ActiveRecord classes.&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;HasBalloon&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;has_balloon?&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;Spot&apos;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;false&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# only Spot has a balloon&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This won’t work &lt;a href=&quot;https://github.com/rails/rails/issues/8934&quot;&gt;(really!)&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  &lt;span class=&quot;n&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:ar_with_balloon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Base&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;attr_accessor&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt;
      &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;HasBalloon&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;flowery_name&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b_f&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}#{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b_f&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;b_f&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;has_balloon?&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;🎈&apos;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;🌸&apos;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So do this instead:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  &lt;span class=&quot;n&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:ar_with_balloon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;AnonymousActiveRecord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;generate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;columns: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;name&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;HasBalloon&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;flowery_name&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b_f&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}#{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b_f&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;b_f&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;has_balloon?&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;🎈&apos;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;🌸&apos;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;can test the module&apos;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ar_with_balloon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;name: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;Spot&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;flowery_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;eq&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;🎈Spot🎈&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ar_with_balloon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;name: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;Not Spot&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;flowery_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;eq&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;🌸Not Spot🌸&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;generate-options&quot;&gt;Generate Options&lt;/h3&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;no&quot;&gt;AnonymousActiveRecord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;generate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;table_name: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;a_table_name&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;c1&quot;&gt;# if table_name is not set klass_basename will be used to derive a unique random table_name&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;# default is a unique random table name&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;klass_basename: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;anons&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# is default&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;columns: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;name&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; 
        &lt;span class=&quot;c1&quot;&gt;# default is [], &lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;# meaning class will have [&apos;id&apos;, &apos;created_at&apos;, &apos;updated_at&apos;], as the AR defaults&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;timestamps: &lt;/span&gt;&lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# is default&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;connection_params: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;adapter: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;sqlite3&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;encoding: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;utf8&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;database: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;:memory:&apos;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# is default&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
   &lt;span class=&quot;c1&quot;&gt;# code which becomes part of the class definition&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The block is optional.&lt;/p&gt;

&lt;h3 id=&quot;factory-options&quot;&gt;Factory Options&lt;/h3&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;no&quot;&gt;AnonymousActiveRecord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;factory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;source_data: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[{&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;name: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;Phil&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;name: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;Vickie&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}],&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;# Array of hashes, where each hash represents a record that will be created&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ... The rest of the options are the same as for generate, see above.&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# same as for generate, see above.&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The block is optional.&lt;/p&gt;

&lt;p&gt;There is also a &lt;code class=&quot;highlighter-rouge&quot;&gt;factory!&lt;/code&gt; method that will raise if the create fails, accomplished by calling &lt;code class=&quot;highlighter-rouge&quot;&gt;create!&lt;/code&gt; instead of &lt;code class=&quot;highlighter-rouge&quot;&gt;create&lt;/code&gt;.&lt;/p&gt;</content><category term="development" /><category term="ruby" /><category term="rails" /><category term="rubygems" /><category term="anonymous_active_record" /><category term="database" /><category term="active_record" /></entry><entry><title type="html">Introducing anonymous_active_record</title><link href="https://peterboling.com/anonymous_active_record/introducing-anonymous_active_record/" rel="alternate" type="text/html" title="Introducing anonymous_active_record" /><published>2018-01-03T00:00:00+00:00</published><updated>2018-01-03T00:00:00+00:00</updated><id>https://peterboling.com/anonymous_active_record/introducing-anonymous_active_record/</id><content type="html" xml:base="https://peterboling.com/anonymous_active_record/introducing-anonymous_active_record/">&lt;div id=&quot;badges&quot;&gt;

&lt;div align=&quot;center&quot;&gt;

### Getting Started

For more information and detailed examples, please visit the [documentation](https://github.com/galtzo-floss/anonymous_active_record).


### Supporting this Project
- [OpenCollective](https://opencollective.com/galtzo-floss)

&lt;/div&gt;&lt;/div&gt;</content><category term="introduction" /><category term="anonymous_active_record" /></entry></feed>