# Uncategorized

**URL:** https://discourse.rom-rb.org/c/uncategorized/1.md

[Latest](https://discourse.rom-rb.org/latest.md) · [Categories](https://discourse.rom-rb.org/categories.md)

---

## [Implementing transient attributes](https://discourse.rom-rb.org/t/implementing-transient-attributes/704)

<div class="topic-metadata">

**Author:** [@rickenharp](https://discourse.rom-rb.org/u/rickenharp)\
**Replies:** 2\
**Last updated:** [October 9, 2025, 9:07am UTC](https://discourse.rom-rb.org/t/implementing-transient-attributes/704 "2025-10-09T09:07:19Z")

</div>

I needed transient attributes in ROM::Factory for my Hanami app. Since all I could find was this old post (Support transient attributes in rom-factory), I took a stab at implementing transient attributes myself. I have …

---

## [Attribute serialization](https://discourse.rom-rb.org/t/attribute-serialization/700)

<div class="topic-metadata">

**Author:** [@pointlessone](https://discourse.rom-rb.org/u/pointlessone)\
**Replies:** 4\
**Last updated:** [August 8, 2025, 1:01pm UTC](https://discourse.rom-rb.org/t/attribute-serialization/700 "2025-08-08T13:01:52Z")

</div>

I’m trying to figure out how to serialize attribute to store in the db. I have Items, they can have multiple tags. On the app side I want them represented as an array of strings but in the db it’s stored in a string col…

---

## [Migration file: Default value for timestamp column](https://discourse.rom-rb.org/t/migration-file-default-value-for-timestamp-column/702)

<div class="topic-metadata">

**Author:** [@jignesh](https://discourse.rom-rb.org/u/jignesh)\
**Replies:** 1\
**Last updated:** [July 7, 2025, 9:23pm UTC](https://discourse.rom-rb.org/t/migration-file-default-value-for-timestamp-column/702 "2025-07-07T21:23:47Z")

</div>

In my Hanami 2.2 app I have a migration file having following code: # frozen\_string\_literal: true ROM::SQL.migration do # Add your migration here. # # See https://guides.hanamirb.org/v2.2/database/migrations/ for…

---

## [How to properly set association to a self junction table?](https://discourse.rom-rb.org/t/how-to-properly-set-association-to-a-self-junction-table/696)

<div class="topic-metadata">

**Author:** [@Franck](https://discourse.rom-rb.org/u/Franck)\
**Replies:** 1\
**Last updated:** [May 23, 2025, 6:59am UTC](https://discourse.rom-rb.org/t/how-to-properly-set-association-to-a-self-junction-table/696 "2025-05-23T06:59:33Z")

</div>

Hi there, I’m trying to figure out my association setting. Here is a MWE : A users table, and a mentoring table. Each user can mentor any number of other users (mentees). And each mentee could be mentored by any number…

---

## [Associating existing database entries with has\_many :through](https://discourse.rom-rb.org/t/associating-existing-database-entries-with-has-many-through/677)

<div class="topic-metadata">

**Author:** [@rickenharp](https://discourse.rom-rb.org/u/rickenharp)\
**Replies:** 0\
**Last updated:** [February 20, 2025, 9:44am UTC](https://discourse.rom-rb.org/t/associating-existing-database-entries-with-has-many-through/677 "2025-02-20T09:44:15Z")

</div>

I’m evaluating using ROM instead of Sequel for a new project, and I have run into a problem: we have specifications and targets. Each specification can have many targets, and each target can have many specifications. To…

---

## [Postgresql schemas (search\_path)](https://discourse.rom-rb.org/t/postgresql-schemas-search-path/669)

<div class="topic-metadata">

**Author:** [@krautcat](https://discourse.rom-rb.org/u/krautcat)\
**Replies:** 2\
**Last updated:** [January 23, 2025, 6:35pm UTC](https://discourse.rom-rb.org/t/postgresql-schemas-search-path/669 "2025-01-23T18:35:32Z")

</div>

Hi there, I have a setup of PostgreSQL database with multiple schemas. They have some tables with the same name. Is there any possibility use multiple gateways for different search\_paths?

---

## [Local variable override field in query](https://discourse.rom-rb.org/t/local-variable-override-field-in-query/665)

<div class="topic-metadata">

**Author:** [@vladimirtcats](https://discourse.rom-rb.org/u/vladimirtcats)\
**Replies:** 2\
**Last updated:** [November 22, 2024, 5:27am UTC](https://discourse.rom-rb.org/t/local-variable-override-field-in-query/665 "2024-11-22T05:27:48Z")

</div>

Hi everyone I have table with column “metadata”, variable metadata and the query metadata contains hash when I run this query: scope = scope.where { metadata.contain(level: metadata\[:level\]) } I get error: undefine…

---

## [Consideration of standard gem](https://discourse.rom-rb.org/t/consideration-of-standard-gem/449)

<div class="topic-metadata">

**Author:** [@pmackay](https://discourse.rom-rb.org/u/pmackay)\
**Replies:** 2\
**Last updated:** [June 22, 2023, 10:31am UTC](https://discourse.rom-rb.org/t/consideration-of-standard-gem/449 "2023-06-22T10:31:13Z")

</div>

Has the idea of using the standard gem for consolidating rubocop and code formatting been considered? It recently hit 1.0.

---

## [Passing values to mapper without using "map\_with"](https://discourse.rom-rb.org/t/passing-values-to-mapper-without-using-map-with/593)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 5\
**Last updated:** [February 17, 2023, 7:47am UTC](https://discourse.rom-rb.org/t/passing-values-to-mapper-without-using-map-with/593 "2023-02-17T07:47:18Z")

</div>

In the documentation (ROM - Mappers) you can use the \>\> operator to pass data to a custom mapper. If I have defined a mapper class inheriting from ROM::Transformer, what would the syntax be to pass data to it via \>\> (or…

---

## [Automatic created\_at and updated\_at](https://discourse.rom-rb.org/t/automatic-created-at-and-updated-at/96)

<div class="topic-metadata">

**Author:** [@stefan.sedich](https://discourse.rom-rb.org/u/stefan.sedich)\
**Replies:** 4\
**Last updated:** [November 25, 2022, 12:29pm UTC](https://discourse.rom-rb.org/t/automatic-created-at-and-updated-at/96 "2022-11-25T12:29:18Z")

</div>

I see in the rom-rails there is a way to do this, I am not on rails fortunately. What would be the best way to have these fields and have them populated and the updated\_at field populated on save? at the moment I am ma…

---

## [Joins with custom dataset](https://discourse.rom-rb.org/t/joins-with-custom-dataset/557)

<div class="topic-metadata">

**Author:** [@wuarmin](https://discourse.rom-rb.org/u/wuarmin)\
**Replies:** 0\
**Last updated:** [September 19, 2022, 8:00am UTC](https://discourse.rom-rb.org/t/joins-with-custom-dataset/557 "2022-09-19T08:00:35Z")

</div>

Hey, I have following use-case: I want to create a UserMentions-relation, which is derived from a mentions-table by using group by. It should only provide one entry per issue, user and read flag. class UserMention…

---

## [How to register changesets with rom config](https://discourse.rom-rb.org/t/how-to-register-changesets-with-rom-config/535)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 3\
**Last updated:** [April 28, 2022, 5:29am UTC](https://discourse.rom-rb.org/t/how-to-register-changesets-with-rom-config/535 "2022-04-28T05:29:52Z")

</div>

The guide ROM - Framework setup mentions relations, commands, and mappers but nothing on changesets. I am currently using auto\_registration with a namespace. I have tried a few things to no avail. Where should I put thi…

---

## [How can I improve this query?](https://discourse.rom-rb.org/t/how-can-i-improve-this-query/533)

<div class="topic-metadata">

**Author:** [@elithecho](https://discourse.rom-rb.org/u/elithecho)\
**Replies:** 0\
**Last updated:** [April 18, 2022, 11:37am UTC](https://discourse.rom-rb.org/t/how-can-i-improve-this-query/533 "2022-04-18T11:37:40Z")

</div>

I have a small repo for trying out ROM and using multi\_insert. I think it could be improved but am wondering how can I do this without a separate query?

---

## [ROM::Processor::Transproc::Functions missing Recursion](https://discourse.rom-rb.org/t/rom-functions-missing-recursion/518)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 1\
**Last updated:** [March 28, 2022, 7:19am UTC](https://discourse.rom-rb.org/t/rom-functions-missing-recursion/518 "2022-03-28T07:19:22Z")

</div>

Is there a reason “import ::Transproc::Recursion” has been omitted?

---

## [Building a ROM plugin for Airtable](https://discourse.rom-rb.org/t/building-a-rom-plugin-for-airtable/495)

<div class="topic-metadata">

**Author:** [@pmackay](https://discourse.rom-rb.org/u/pmackay)\
**Replies:** 2\
**Last updated:** [February 23, 2022, 8:54pm UTC](https://discourse.rom-rb.org/t/building-a-rom-plugin-for-airtable/495 "2022-02-23T20:54:21Z")

</div>

I’m looking at using ROM with Airtable. Each “base” in Airtable has a clear REST API that is based on the structure of the tables added to the base. Based on the docs from the rom-http 0.8.0 tag, I can see 3 possible way…

---

## [How to create Entity programmatically with relations?](https://discourse.rom-rb.org/t/how-to-create-entity-programmatically-with-relations/498)

<div class="topic-metadata">

**Author:** [@wuarmin](https://discourse.rom-rb.org/u/wuarmin)\
**Replies:** 2\
**Last updated:** [February 3, 2022, 7:28am UTC](https://discourse.rom-rb.org/t/how-to-create-entity-programmatically-with-relations/498 "2022-02-03T07:28:12Z")

</div>

Hey, I need to create an Entity programmatically, but I have issues. I have an entity Booking (id, name, area) which holds an Area (id, name) and I need to create this Bookings from hashes: # relation module Relatio…

---

## [How to use template-gem?](https://discourse.rom-rb.org/t/how-to-use-template-gem/493)

<div class="topic-metadata">

**Author:** [@pmackay](https://discourse.rom-rb.org/u/pmackay)\
**Replies:** 1\
**Last updated:** [January 4, 2022, 9:05am UTC](https://discourse.rom-rb.org/t/how-to-use-template-gem/493 "2022-01-04T09:05:37Z")

</div>

Are there any docs on how to use template-gem to start creating a new ROM gem? Could the project itself have its own README, that must be removed when cloning to make a new gem?

---

## [Classifying rom gems in Ruby Toolbox](https://discourse.rom-rb.org/t/classifying-rom-gems-in-ruby-toolbox/492)

<div class="topic-metadata">

**Author:** [@pmackay](https://discourse.rom-rb.org/u/pmackay)\
**Replies:** 1\
**Last updated:** [January 4, 2022, 9:04am UTC](https://discourse.rom-rb.org/t/classifying-rom-gems-in-ruby-toolbox/492 "2022-01-04T09:04:04Z")

</div>

I use Ruby Toolbox quite a lot when reviewing gems. The addition and classification of ROM gems could be improved on there. Just curious on people’s thoughts about which of these seems more appropriate: Add rom gems to…

---

## [Did anyone actually make this work with Ruby on Rails?](https://discourse.rom-rb.org/t/did-anyone-actually-make-this-work-with-ruby-on-rails/490)

<div class="topic-metadata">

**Author:** [@idchlife](https://discourse.rom-rb.org/u/idchlife)\
**Replies:** 0\
**Last updated:** [November 25, 2021, 8:49pm UTC](https://discourse.rom-rb.org/t/did-anyone-actually-make-this-work-with-ruby-on-rails/490 "2021-11-25T20:49:22Z")

</div>

Hey there! I’m trying to learn Ruby on Rails since I learned there is data mapper ORM for ruby (active record was major stopper for me in learning ruby). Did anyone actually used ROM with Ruby with Mysql/PostgreSQL/SQLit…

---

## [What is the best way to solve following association-scenario?](https://discourse.rom-rb.org/t/what-is-the-best-way-to-solve-following-association-scenario/477)

<div class="topic-metadata">

**Author:** [@wuarmin](https://discourse.rom-rb.org/u/wuarmin)\
**Replies:** 0\
**Last updated:** [September 2, 2021, 9:51am UTC](https://discourse.rom-rb.org/t/what-is-the-best-way-to-solve-following-association-scenario/477 "2021-09-02T09:51:52Z")

</div>

Hello, I have following tables: main-table records (id, source\_name, source\_id, …), i.e. \[{15, “source\_one”, 89}, {16, “source\_two”, 89\] source-tables source\_one\_records (id, …) source\_two\_records (id, …) Every re…

---

## [ROM Attribute identity](https://discourse.rom-rb.org/t/rom-attribute-identity/455)

<div class="topic-metadata">

**Author:** [@alex-lairan](https://discourse.rom-rb.org/u/alex-lairan)\
**Replies:** 2\
**Last updated:** [April 22, 2021, 7:13am UTC](https://discourse.rom-rb.org/t/rom-attribute-identity/455 "2021-04-22T07:13:50Z")

</div>

Hi, There is a way in ROM to deal with identities? Sometimes I play with monads to create my queries and I finish with things like that : filter1 : ROM::SQL::Attribute filter2 : ROM::SQL::Attribute maybe\_filter3 : May…

---

## [LDAP support for ROM](https://discourse.rom-rb.org/t/ldap-support-for-rom/384)

<div class="topic-metadata">

**Author:** [@abhas](https://discourse.rom-rb.org/u/abhas)\
**Replies:** 3\
**Last updated:** [April 19, 2021, 12:46pm UTC](https://discourse.rom-rb.org/t/ldap-support-for-rom/384 "2021-04-19T12:46:08Z")

</div>

Dear ROM community, I just discovered ROM a few minutes back and I already find the whole idea of ROM extremely sensible and useful. I would like to build LDAP support for it so that I can use ROM with OpenLDAP. I curre…

---

## [QUESTION: Encryption support thoughts](https://discourse.rom-rb.org/t/question-encryption-support-thoughts/387)

<div class="topic-metadata">

**Author:** [@butsjoh](https://discourse.rom-rb.org/u/butsjoh)\
**Replies:** 9\
**Last updated:** [August 7, 2020, 9:52am UTC](https://discourse.rom-rb.org/t/question-encryption-support-thoughts/387 "2020-08-07T09:52:04Z")

</div>

Hi, I would like to have an idea on how encryption at the application level together with rom can be supported. We have something working but it requires some hacks because of the usage of dry types. So i am just reachi…

---

## [Rom-sql |\> Rake task for db:dump || alternative?](https://discourse.rom-rb.org/t/rom-sql-rake-task-for-db-dump-alternative/381)

<div class="topic-metadata">

**Author:** [@gadimbaylisahil](https://discourse.rom-rb.org/u/gadimbaylisahil)\
**Replies:** 2\
**Last updated:** [June 15, 2020, 11:20am UTC](https://discourse.rom-rb.org/t/rom-sql-rake-task-for-db-dump-alternative/381 "2020-06-15T11:20:11Z")

</div>

Hi, guys! Awesome work on ROM. Thanks for everyone involved. I introduced it to the Rails 6 application, which took a little time but all works now. However, I need to create database dumps like schema.rb structure.sql…

---

## [ROM-Rails does not support namespaced relations](https://discourse.rom-rb.org/t/rom-rails-does-not-support-namespaced-relations/354)

<div class="topic-metadata">

**Author:** [@tycooon](https://discourse.rom-rb.org/u/tycooon)\
**Replies:** 0\
**Last updated:** [March 11, 2020, 5:01pm UTC](https://discourse.rom-rb.org/t/rom-rails-does-not-support-namespaced-relations/354 "2020-03-11T17:01:00Z")

</div>

It forces namespace: false here: https://github.com/rom-rb/rom-rails/blob/master/lib/rom/rails/railtie.rb#L81 Would be great to have it configurable, because I prefer to organize my code in a way that app/relations/user…

---

## [Polymorphic Association](https://discourse.rom-rb.org/t/polymorphic-association/338)

<div class="topic-metadata">

**Author:** [@captainhusaynpinguin](https://discourse.rom-rb.org/u/captainhusaynpinguin)\
**Replies:** 1\
**Last updated:** [December 1, 2019, 2:26am UTC](https://discourse.rom-rb.org/t/polymorphic-association/338 "2019-12-01T02:26:28Z")

</div>

Hi there, I’m new to Ruby & co and I just played with Rails and trying to migrate a CSM to Hanami. As Hanami’s default is ROM, I was wondering if there is the polymorphic association in ROM? Why not? In my naive view, …

---

## [Format timestamps for JSON payload](https://discourse.rom-rb.org/t/format-timestamps-for-json-payload/311)

<div class="topic-metadata">

**Author:** [@mdi](https://discourse.rom-rb.org/u/mdi)\
**Replies:** 5\
**Last updated:** [July 3, 2019, 9:16am UTC](https://discourse.rom-rb.org/t/format-timestamps-for-json-payload/311 "2019-07-03T09:16:24Z")

</div>

What’s the recommended way to format timestamps coming out of the db? For example, I’d like all timestamps to be formatted as ISO 8601 when they are sent down the wire in a JSON payload.

---

## [Apply a default filter per relation for a multi tenant app](https://discourse.rom-rb.org/t/apply-a-default-filter-per-relation-for-a-multi-tenant-app/310)

<div class="topic-metadata">

**Author:** [@calin](https://discourse.rom-rb.org/u/calin)\
**Replies:** 5\
**Last updated:** [May 25, 2019, 4:49pm UTC](https://discourse.rom-rb.org/t/apply-a-default-filter-per-relation-for-a-multi-tenant-app/310 "2019-05-25T16:49:53Z")

</div>

Hi, I am working on a multi tenant app, so I need some relations to be filtered by tentant. So some of them will have a tenant\_id and right now I have a method in the relation for\_tenant that I need to chain to all cal…

---

## [Where with like](https://discourse.rom-rb.org/t/where-with-like/256)

<div class="topic-metadata">

**Author:** [@xero88](https://discourse.rom-rb.org/u/xero88)\
**Replies:** 2\
**Last updated:** [June 21, 2018, 12:30pm UTC](https://discourse.rom-rb.org/t/where-with-like/256 "2018-06-21T12:30:00Z")

</div>

I’m trying to search in my table. I found this : contacts.where { email.ilike('%myemail%') }.to\_a this work fine. But I want to do like this : contacts.where { "email".ilike('%myemail%') }.to\_a because my fields are…

---

## [Constructing complicated queries](https://discourse.rom-rb.org/t/constructing-complicated-queries/255)

<div class="topic-metadata">

**Author:** [@paul](https://discourse.rom-rb.org/u/paul)\
**Replies:** 0\
**Last updated:** [May 19, 2018, 9:33pm UTC](https://discourse.rom-rb.org/t/constructing-complicated-queries/255 "2018-05-19T21:33:36Z")

</div>

I have a moderately complicated data model in postgresql with lots of relations, and I need to gather them all together for display in a view. I have a Conversation which associates with a few other objects, which have …

[Next page](https://discourse.rom-rb.org/c/uncategorized/1.md?page=1)
