Slide 1

Slide 1 text

Miha Rekar Rails 7.1

Slide 2

Slide 2 text

Dockerfile • MRSK

Slide 3

Slide 3 text

Dockerfile • MRSK Kamal • /.env* files are now ignored • gem dockerfile-rails (by Fly)

Slide 4

Slide 4 text

Async queries • async_count • async_sum • async_minimum • async_maximum • async_average • async_pluck • async_pick • async_ids • async_find_by_sql • async_count_by_sql • Check: config.active_record.async_query_executor

Slide 5

Slide 5 text

Common Table Expressions

Slide 6

Slide 6 text

ActiveRecord::Relation#explain • now accepts options • query.explain(“ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON") • query.explain("ANALYZE", "COSTS", "VERBOSE", "BUFFERS", "FORMAT JSON”) • https://explain.dalibo.com/

Slide 7

Slide 7 text

#select Accepts a Hash

Slide 8

Slide 8 text

ActiveRecord::Base.normalizes

Slide 9

Slide 9 text

Composite keys • both at the database and at application level • derived from schema • mainly for many-to-many relationships • virtual primary key via query_constraints • composite foreign key on association

Slide 10

Slide 10 text

BYO Authentication • Devise is ! • User.authenticate_by( email: “[email protected]", password: “rails4ever” ) • lazaronixon/authentication-zero • passkeys (WebAuthn)

Slide 11

Slide 11 text

ActiveSupport::MessagePack • new serializer that integrates with the msgpack gem • can reduce payload size and improve performance compared to JSON and Marshal

Slide 12

Slide 12 text

ActiveJob.perform_all_later • single redis/pg call

Slide 13

Slide 13 text

Rails.env.local? • Goodbye if Rails.env.development? || Rails.env.test? • Hello if Rails.env.local?

Slide 14

Slide 14 text

config.sandbox_by_default • start rails console in sandbox mode by default • useful to set for production environments

Slide 15

Slide 15 text

Support Bun • all-in-one JS/TS runtime & toolkit designed for speed, complete with a bundler, test runner, and Node.js-compatible package manager. • I know nothing about this • other people are excited

Slide 16

Slide 16 text

ICYMI • Ruby 3.3's YJIT is amazing • New register allocator • More code now gets JIT compiled • For Shopify: • 13% faster than 3.2 YJIT • 15% faster than 3.3 without YJIT • For Basecamp: • +24% faster on the median, +12% on the average

Slide 17

Slide 17 text

Ready for production?

Slide 18

Slide 18 text

rails app:update just do it

Slide 19

Slide 19 text

Thanks!