#activerecord

2025-05-27

JRuby's activerecord-jdbc-adapter doesn't yet support ActiveRecord 8. How should a gem which depends on ActiveRecord try to best support both CRuby and JRuby?
rubygems.org/gems/activerecord

#activerecord #jruby

Esparta :ruby:esparta@ruby.social
2025-04-01

Wide Models and Active Record custom validation contexts, by @bensheldon

island94.org/2025/04/wide-mode

> This post is a brief description of a pattern I use a lot using when building features in Ruby on Rails apps and that I think needed a name:

> Wide Models have many attributes (columns in the database) that are updated in multiple places in the application, but not always all at once i.e. different forms will update different subsets of attributes on the same model.

#ruby #ActiveRecord

Esparta :ruby:esparta@ruby.social
2025-03-31

How fast can an ActiveRecord SQL query run?, by Fritz Meissner
thoughtbot.com/blog/how-fast-c

> Your database monitoring (perhaps Amazon RDS performance insights, Skylight, or the #Postgres pg_stat_activity view) is telling you that one particular query in your Rails app is causing heavy load. Unfortunately, it already seems pretty fast. What are the odds that you can get it to run any faster?

#ruby #SQL #ActiveRecord

2025-02-28

It's always great to see @rosa and she talked about her #SolidQueue implementation at #rubycommunityconference in #krakow.

She also gave a shout-out to @bensheldon's #goodjob and mentioned how @getajobmike's @sidekiq is blazingly fast.

#ruby #rails #queue #rubyonrails #activerecord #poland #37signals #backgroundprocessing #backgroundprocesses #sidekiq

Rosa on stage at Ruby Community Conference
2025-02-12

New from Julie Kent:

Imaging you have a Rails endpoint that has slow queries AND performs third-party HTTP requests. With Rails async queries, you can perform these operations in parallel—without being an expert in multithreading. 🚀

honeybadger.io/blog/rails-asyn

#Ruby #RubyOnRails #ActiveRecord #Performance #Programming

Todd A. Jacobs | Rubyisttodd_a_jacobs@ruby.social
2025-01-31

I know #SQLite3 supports #SQL comments in newer versions with the right flags, but `rails g` for #ActiveRecord ďoesn’t seem to support them except in #PostgreSQL or #MySQL / #MariaDB. Is there a workaround?

2024-12-22

Made a gem out of an earlier proof-of-concept: github.com/henrik/activemodel-

This lets you do things like

``` ruby
with_conditions(if: :feature_x_is_on?) do
validate :free_plans_must_have_x, if: :free_plan?
end
```

where the conditions merge intuitively, unlike `with_options`.

#RubyOnRails #ActiveRecord #ActiveModel

:rss: Qiita - 人気の記事qiita@rss-mstdn.studiofreesia.com
2024-10-28

【Rails】エラー「ArgumentError: Relation passed to #or must be structurally compatible. 」とorメソッドについて
qiita.com/k12da/items/f06f9997

#qiita #Rails #ActiveRecord

Clairement crevéeClaire@sitedethib.com
2024-10-11

ok, #Rails #ActiveRecord thing:

Some people upgrading to Mastodon 4.3.0 seem to have messed up their migration relating to Active Record Encryption, by changing the secrets at some point after they first used them.

Of course since the keys have changed, the encrypted columns are irrevocably lost, and nothing can be done about that. But is there something we can do to lessen the risks of people running into that by catching the issue earlier?

Also, even overwriting those attributes is not possible in normal Rails code because save!ing will call attribute_changed? which will in turn try to decrypt the value to compare it, and raise an exception. Is there a way we can better handle columns that fail to decrypt when we are just interested in overriding them?

2024-09-19

Am I the only one that dont like other ORMs than Rails Active Record? I mean, FastAPI's SQLAlchemy, SQLModel in combination with pydantic as well as Symfonys Doctrine feels a little bit pain in the a** when it comes to complex relations. Active Record just feels smooth compared to the other ones...

#rubyonrails #activerecord #fastapi #sqlalchemy #sqlmodel #pydantic #doctrine #symfony #python #orm #database

Esparta :ruby:esparta@ruby.social
2024-06-03

Eradicating N+1s: The Two-phase Data Load and Render Pattern in Go, by @brandur

> Using a two-phase data load and render pattern to prevent N+1 queries in a generalized way. Especially useful in Go, but applicable in any language.

#golang #ActiveRecord #ruby

Andreas Hallerahx@ruby.social
2024-05-29

Today I used generated columns in SQL for the first time. These are computed columns that are updated on write and can be indexed. They work with PostgreSQL, MySQL and even SQLite.

Adding a migration via the Sequel gem was pretty straight forward. ActiveRecord has also built-in support for generated columns.

Here is a great overview about this: medium.com/the-table-sql-and-d

#sql #ruby #sequel #activerecord

2024-05-28

Why is ActiveRecord > 7.1 still broken on JRuby? Appears activerecord-jdbc-adapter still hasn't been updated.
github.com/ronin-rb/ronin-db-a
#activerecord #jruby

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst