# Latest

**URL:** https://discourse.rom-rb.org/latest.md?no_subcategories=false&page=1

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

**Page:** 2

---

## [ROM 5.0 Roadmap](https://discourse.rom-rb.org/t/rom-5-0-roadmap/210)

<div class="topic-metadata">

**Author:** [@solnic](https://discourse.rom-rb.org/u/solnic)\
**Replies:** 10\
**Last updated:** [June 22, 2023, 11:29am UTC](https://discourse.rom-rb.org/t/rom-5-0-roadmap/210 "2023-06-22T11:29:37Z")

</div>

:warning:ROADMAP WAS CHANGED =\> https://discourse.rom-rb.org/t/changed-5-0-0-roadmap/278⚠️ Hey folks, We’ve got a roadmap for version 5.0 and I’d like to summarize what we’re planning to do in this next major upgrade…

---

## [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.

---

## [What made you interested in ROM?](https://discourse.rom-rb.org/t/what-made-you-interested-in-rom/28)

<div class="topic-metadata">

**Author:** [@solnic](https://discourse.rom-rb.org/u/solnic)\
**Replies:** 16\
**Last updated:** [June 22, 2023, 10:24am UTC](https://discourse.rom-rb.org/t/what-made-you-interested-in-rom/28 "2023-06-22T10:24:32Z")

</div>

I'm always very curious to know how people discover the project and what is their motivation to learn it and try it out. Please tell me your story, even when it wasn't successful. If ROM didn't meet your requirements ple…

---

## [ROM SQL CTE tables](https://discourse.rom-rb.org/t/rom-sql-cte-tables/433)

<div class="topic-metadata">

**Author:** [@alex-lairan](https://discourse.rom-rb.org/u/alex-lairan)\
**Replies:** 6\
**Last updated:** [June 22, 2023, 9:32am UTC](https://discourse.rom-rb.org/t/rom-sql-cte-tables/433 "2023-06-22T09:32:35Z")

</div>

Hi. It is possible to do CTE table query with ROM SQL or we have to handle it at the Sequel level? I didn’t find anything on the source code of the gem so I am asking. And if no, what would be the steps to implement i…

---

## [ROM upsert and schema validation](https://discourse.rom-rb.org/t/rom-upsert-and-schema-validation/605)

<div class="topic-metadata">

**Author:** [@ridget](https://discourse.rom-rb.org/u/ridget)\
**Replies:** 2\
**Last updated:** [May 22, 2023, 10:45pm UTC](https://discourse.rom-rb.org/t/rom-upsert-and-schema-validation/605 "2023-05-22T22:45:11Z")

</div>

Hi friends - wondering if I can get some 2c - relative noob to ROM I was attempting to use relation.upsert with options but found that it wasn’t validating via the schema - which appears to be expected behaviour. Inste…

---

## [Relation schema attribute default value?](https://discourse.rom-rb.org/t/relation-schema-attribute-default-value/603)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 0\
**Last updated:** [May 17, 2023, 2:42pm UTC](https://discourse.rom-rb.org/t/relation-schema-attribute-default-value/603 "2023-05-17T14:42:48Z")

</div>

Is there a way to configure a default value in the relation schema for an attribute? attribute :type, Types::Strict::String.enum('hard', 'soft'), default: 'soft' So when I execute the following where ‘type’ key is miss…

---

## [ROM 5.3.0 support for Ruby 3?](https://discourse.rom-rb.org/t/rom-5-3-0-support-for-ruby-3/567)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 2\
**Last updated:** [May 5, 2023, 6:15pm UTC](https://discourse.rom-rb.org/t/rom-5-3-0-support-for-ruby-3/567 "2023-05-05T18:15:18Z")

</div>

When using ruby 3.1.2 these warnings cause crashes. /gems/rom-core-5.3.0/lib/rom/relation/combined.rb:145: warning: Using the last argument as keyword parameters is deprecated; maybe \*\* should be added to the call /gem…

---

## [Adding the \`.rom\` suffix to emitted events](https://discourse.rom-rb.org/t/adding-the-rom-suffix-to-emitted-events/599)

<div class="topic-metadata">

**Author:** [@luismiramirez](https://discourse.rom-rb.org/u/luismiramirez)\
**Replies:** 3\
**Last updated:** [March 6, 2023, 8:16am UTC](https://discourse.rom-rb.org/t/adding-the-rom-suffix-to-emitted-events/599 "2023-03-06T08:16:41Z")

</div>

Hey there! Would it be possible to add the .rom suffix to the events emitted through the instrumentation plugin? It’s how ActiveRecord works with ActiveSupport::Notifications and it’ll make things easier to identify dif…

---

## [Resurrecting Sinatra-Rom](https://discourse.rom-rb.org/t/resurrecting-sinatra-rom/590)

<div class="topic-metadata">

**Author:** [@mslinn](https://discourse.rom-rb.org/u/mslinn)\
**Replies:** 2\
**Last updated:** [February 22, 2023, 2:03pm UTC](https://discourse.rom-rb.org/t/resurrecting-sinatra-rom/590 "2023-02-22T14:03:09Z")

</div>

I am learning Sinatra and Rom. I forked the dusty sinatra-rom project on GitHub. I run the program with bundle exec rackup. I am working through the issues. This one has me stumped: db/commands/products/create.rb thro…

---

## [What's the better repo-approach? General repo-methods vs. specific repo-methods](https://discourse.rom-rb.org/t/whats-the-better-repo-approach-general-repo-methods-vs-specific-repo-methods/595)

<div class="topic-metadata">

**Author:** [@wuarmin](https://discourse.rom-rb.org/u/wuarmin)\
**Replies:** 3\
**Last updated:** [February 21, 2023, 4:30pm UTC](https://discourse.rom-rb.org/t/whats-the-better-repo-approach-general-repo-methods-vs-specific-repo-methods/595 "2023-02-21T16:30:47Z")

</div>

Hey, I’m very interested about your opinions about following 2 repo approaches: 1. Approach (general methods) # users\_repo.rb class UsersRepo def find(id, \*\*opts) get\_relation(opts).by\_pk(id).one! end priva…

---

## [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…

---

## [ROM Is a Failed Project](https://discourse.rom-rb.org/t/rom-is-a-failed-project/592)

<div class="topic-metadata">

**Author:** [@mslinn](https://discourse.rom-rb.org/u/mslinn)\
**Replies:** 1\
**Last updated:** [February 6, 2023, 4:04am UTC](https://discourse.rom-rb.org/t/rom-is-a-failed-project/592 "2023-02-06T04:04:44Z")

</div>

I used Ruby Data Mapper and liked it. Stuff worked, documentation lined up with shipped bits. Then I learned that it had been abandoned in favor of ROM - supposedly a version 2, but actually ROM is a completely different…

---

## [Attemping to generate a schema](https://discourse.rom-rb.org/t/attemping-to-generate-a-schema/588)

<div class="topic-metadata">

**Author:** [@rfb](https://discourse.rom-rb.org/u/rfb)\
**Replies:** 1\
**Last updated:** [January 27, 2023, 8:04pm UTC](https://discourse.rom-rb.org/t/attemping-to-generate-a-schema/588 "2023-01-27T20:04:34Z")

</div>

Hi there, I’m attempting to add attributes to a schema using an external configuration, but it appears the blocks passed into the DSL are stripped of their execution context. Are there any other options for creating a …

---

## [How to implement state machine when using ROM for persistence](https://discourse.rom-rb.org/t/how-to-implement-state-machine-when-using-rom-for-persistence/585)

<div class="topic-metadata">

**Author:** [@masterT](https://discourse.rom-rb.org/u/masterT)\
**Replies:** 0\
**Last updated:** [January 19, 2023, 10:36am UTC](https://discourse.rom-rb.org/t/how-to-implement-state-machine-when-using-rom-for-persistence/585 "2023-01-19T10:36:43Z")

</div>

Coming from the Rails and ActiveRecord world, I am wondering how to implement an application that uses state machine using ROM (rom-sql and rom-repository). I was previously using the gem AASM, but I know there are other…

---

## [How to handle root key in JSON API responses (rom-http)](https://discourse.rom-rb.org/t/how-to-handle-root-key-in-json-api-responses-rom-http/584)

<div class="topic-metadata">

**Author:** [@mbajur](https://discourse.rom-rb.org/u/mbajur)\
**Replies:** 0\
**Last updated:** [January 19, 2023, 10:22am UTC](https://discourse.rom-rb.org/t/how-to-handle-root-key-in-json-api-responses-rom-http/584 "2023-01-19T10:22:48Z")

</div>

Hello! I’m writing a custom HTTP adapter for one of the APIs i have to consume and all the list resources are returning their data under the parent node. So, for a list of products, the response would be: { "products…

---

## [How do I express a NOT IN using ROM?](https://discourse.rom-rb.org/t/how-do-i-express-a-not-in-using-rom/582)

<div class="topic-metadata">

**Author:** [@abrokenjester](https://discourse.rom-rb.org/u/abrokenjester)\
**Replies:** 1\
**Last updated:** [January 18, 2023, 10:41pm UTC](https://discourse.rom-rb.org/t/how-do-i-express-a-not-in-using-rom/582 "2023-01-18T22:41:30Z")

</div>

Hi folks, new ROM user here. I’m trying to express the following SQL query using ROM: SELECT id, name FROM rel WHERE ((rel.account = '...') AND rel.id NOT IN (SELECT id FROM ....)) The subselect returns a set of ids …

---

## [Associations between multiple databases](https://discourse.rom-rb.org/t/associations-between-multiple-databases/577)

<div class="topic-metadata">

**Author:** [@wbr](https://discourse.rom-rb.org/u/wbr)\
**Replies:** 3\
**Last updated:** [January 11, 2023, 10:58pm UTC](https://discourse.rom-rb.org/t/associations-between-multiple-databases/577 "2023-01-11T22:58:45Z")

</div>

Hi, I’ve been using ROM for several years but never between multiple databases at once, until now. I’m trying to create an association between a postgres relation and a sqlite relation. My container has two gateways, one…

---

## [Is there a possibility to skip the tuple-diff check at update-changesets?](https://discourse.rom-rb.org/t/is-there-a-possibility-to-skip-the-tuple-diff-check-at-update-changesets/575)

<div class="topic-metadata">

**Author:** [@wuarmin](https://discourse.rom-rb.org/u/wuarmin)\
**Replies:** 0\
**Last updated:** [December 22, 2022, 8:23am UTC](https://discourse.rom-rb.org/t/is-there-a-possibility-to-skip-the-tuple-diff-check-at-update-changesets/575 "2022-12-22T08:23:30Z")

</div>

Hey, I want to use the update changeset, but want to skip the tuple-diff-check, which results in a extra sql, of the tuple, which is too expensive? Is that possible? Or do you recommend not using changesets in that cas…

---

## [Select\_append and factories](https://discourse.rom-rb.org/t/select-append-and-factories/566)

<div class="topic-metadata">

**Author:** [@katafrakt](https://discourse.rom-rb.org/u/katafrakt)\
**Replies:** 1\
**Last updated:** [November 27, 2022, 4:52pm UTC](https://discourse.rom-rb.org/t/select-append-and-factories/566 "2022-11-27T16:52:43Z")

</div>

Hello. I have a Threads relation that has\_many :messages. When fetching thread list in the repository, I use select\_append to add message\_count value to the result. Something like this: def with\_count left\_join(messag…

---

## [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…

---

## [Using ROM 5.3.0 Repository with Hanami 2.0](https://discourse.rom-rb.org/t/using-rom-5-3-0-repository-with-hanami-2-0/569)

<div class="topic-metadata">

**Author:** [@jignesh](https://discourse.rom-rb.org/u/jignesh)\
**Replies:** 8\
**Last updated:** [November 24, 2022, 8:06pm UTC](https://discourse.rom-rb.org/t/using-rom-5-3-0-repository-with-hanami-2-0/569 "2022-11-24T20:06:49Z")

</div>

Hello, I am trying to build a web-app prototype with Hanami 2.0 and as part of that I am trying to utilize ROM Repositories. Below shown is the relevant code snippet for a question I have: # startup\_template/slices/adm…

---

## [ROM::Repository::Root purpose and usage](https://discourse.rom-rb.org/t/rom-root-purpose-and-usage/570)

<div class="topic-metadata">

**Author:** [@jignesh](https://discourse.rom-rb.org/u/jignesh)\
**Replies:** 1\
**Last updated:** [November 22, 2022, 8:25pm UTC](https://discourse.rom-rb.org/t/rom-root-purpose-and-usage/570 "2022-11-22T20:25:20Z")

</div>

Hello, Can anybody please help me in making understand the purpose of class ROM::Repository::Root and how to use it? In the official documentation on rom-rb website under Repositories I couldn’t find any information …

---

## [Mapper logic reuse - suggestions needed](https://discourse.rom-rb.org/t/mapper-logic-reuse-suggestions-needed/559)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 3\
**Last updated:** [October 17, 2022, 7:22pm UTC](https://discourse.rom-rb.org/t/mapper-logic-reuse-suggestions-needed/559 "2022-10-17T19:22:29Z")

</div>

Hello, I am noticing two patterns: I am creating a mapper for each unique combination of #combine inputs I having a lot of repeating code in my mappers across different relations when I combine associations. Do you h…

---

## [Aggregate write with mapper =\> mapper called 2x](https://discourse.rom-rb.org/t/aggregate-write-with-mapper-mapper-called-2x/558)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 2\
**Last updated:** [October 1, 2022, 12:59pm UTC](https://discourse.rom-rb.org/t/aggregate-write-with-mapper-mapper-called-2x/558 "2022-10-01T12:59:29Z")

</div>

Greetings! The following command (aggregate write) creates correctly but calls the mapper twice. Is this expected behaviour? my\_relation.combine(\[:my\_assoc\]) .command(:create, mapper: :my\_mapper, …

---

## [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…

---

## [Delete Cascade to include associated records?](https://discourse.rom-rb.org/t/delete-cascade-to-include-associated-records/556)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 2\
**Last updated:** [September 16, 2022, 8:57am UTC](https://discourse.rom-rb.org/t/delete-cascade-to-include-associated-records/556 "2022-09-16T08:57:14Z")

</div>

Is it possible to delete records that have an association (foreign key) to schedule\_elements in a single call? Do I just combine the associated relation? schedule\_elements.where(conditions).command(:delete, result: :man…

---

## [Delete command on relation should return all deleted entities](https://discourse.rom-rb.org/t/delete-command-on-relation-should-return-all-deleted-entities/228)

<div class="topic-metadata">

**Author:** [@joelvh](https://discourse.rom-rb.org/u/joelvh)\
**Replies:** 4\
**Last updated:** [September 13, 2022, 7:51pm UTC](https://discourse.rom-rb.org/t/delete-command-on-relation-should-return-all-deleted-entities/228 "2022-09-13T19:51:20Z")

</div>

According to the code comments, the delete command should return the deleted entities. However, they return one. relation.changeset(:create, {id: 1}, {id: 2}, {id: 3}).commit result = relation.command(:delete).call # …

---

## [Complex conditions: passing a block to where + schema alias](https://discourse.rom-rb.org/t/complex-conditions-passing-a-block-to-where-schema-alias/555)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 5\
**Last updated:** [September 1, 2022, 1:44pm UTC](https://discourse.rom-rb.org/t/complex-conditions-passing-a-block-to-where-schema-alias/555 "2022-09-01T13:44:00Z")

</div>

Where can I find more documentation on restriction DSL to compose more complex conditions? And more specifically if a schema has an alias (… infer: true, as: :events do …) how do I refer to it in a view? def with…

---

## [Why Entity.new does not set attributes?](https://discourse.rom-rb.org/t/why-entity-new-does-not-set-attributes/554)

<div class="topic-metadata">

**Author:** [@swilgosz](https://discourse.rom-rb.org/u/swilgosz)\
**Replies:** 2\
**Last updated:** [August 25, 2022, 9:23am UTC](https://discourse.rom-rb.org/t/why-entity-new-does-not-set-attributes/554 "2022-08-25T09:23:09Z")

</div>

Hi there! Entities are supposed to be very simple struct-like objects, and they use Dry::Struct under the hood. I guess it’s reasonable, that I expect the initialization can happen in the similar way. However, MyEntit…

---

## [Schema Coercion mysql / sqlite integer to boolean](https://discourse.rom-rb.org/t/schema-coercion-mysql-sqlite-integer-to-boolean/551)

<div class="topic-metadata">

**Author:** [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Replies:** 4\
**Last updated:** [August 11, 2022, 2:41pm UTC](https://discourse.rom-rb.org/t/schema-coercion-mysql-sqlite-integer-to-boolean/551 "2022-08-11T14:41:26Z")

</div>

Can someone give me an example of how this can be done? OR how I should be reading these values (0/1) from the database to have them represented by ruby false and true? Thanks!

[Previous page](https://discourse.rom-rb.org/latest.md?no_subcategories=false)

[Next page](https://discourse.rom-rb.org/latest.md?no_subcategories=false&page=2)
