home.social

#activerecord — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #activerecord, aggregated by home.social.

  1. 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

  2. Коммуникация по RESTful API: синхронизируем данные с маркетплейсами

    В статье разбирается код на Ruby и в Ruby on Rails, в частности, на примере задачи по разработке web-сервиса синхронизации данных с внешними источниками. Погружение в программное решение начинается с разбора бизнес-задачи. Через освещение реальных API с маркетплейсов OZON и Яндекс.Маркет обосновываются способы принятия архитектурных решений и способы оптимизации кода. Эта статья также является авторской попыткой раскрыть принцы SOLID при реализации логики реального бэкенд приложения по переработке структурированных данных в условиях эксплуатации стороннего REST API.

    habr.com/ru/articles/796169/

    #ruby_on_rails #restful_api #postgresql #sidekiq #redis #solid #development #logger #ruby #activerecord

  3. Suppose you want a test in #Rails #ActiveRecord that says "make sure this scope has applied".

    How about using `#annotate` in the scope definition, then testing the generated SQL for the presence of the annotation text?

  4. Suppose you want a test in #Rails #ActiveRecord that says "make sure this scope has applied".

    How about using `#annotate` in the scope definition, then testing the generated SQL for the presence of the annotation text?

  5. Suppose you want a test in #Rails #ActiveRecord that says "make sure this scope has applied".

    How about using `#annotate` in the scope definition, then testing the generated SQL for the presence of the annotation text?

  6. Suppose you want a test in #Rails #ActiveRecord that says "make sure this scope has applied".

    How about using `#annotate` in the scope definition, then testing the generated SQL for the presence of the annotation text?

  7. Suppose you want a test in #Rails #ActiveRecord that says "make sure this scope has applied".

    How about using `#annotate` in the scope definition, then testing the generated SQL for the presence of the annotation text?

  8. #Rails #ActiveRecord is very keen on binding variables. Perhaps too keen.

    If you have a polymorphic association `batchable` then you get SQL like `batchable_type = $1`, but you'd need a lot of unique types for the benefits of bind variables to outweight to loss of accurate cardinality estimation, surely.

    And implementing `#exists?` with a bind variable as `LIMIT $1` seems quirky.