[フレーム]
1 - 25 件 / 25件
August 12, 2021 Modern web apps without JavaScript bundling or transpiling I didn't much care for vanilla JavaScript prior to ES6. Through all of the 2000s, I chased different approaches to avoid writing too much of it. First there was RJS (Ruby-to-JavaScript). Then there was CoffeeScript. Both transpiling approaches that turned more enjoyable-to-write source code into the kind of JavaScript that
Rails 7.0ではフロントエンドサポートが刷新されます。新たなライブラリが多数導入され、選択肢が増えるため、「Rails公式のものを選べばOK」という戦略が通用しなくなります。 本稿では、Railsでフロントエンドを書くための選択肢について、その歴史と実装を踏まえて比較検討します。 結論から言うと(まだアルファ版なので今後も状況が変わる可能性はありますが、) 新規アプリケーションではSprocketsの役割は無くなりそうです。新しいライブラリとして Propshaft, importmap-rails, jsbundling-rails, cssbundling-rails が登場し、主要な選択肢として以下が提供されます。 (各ライブラリの詳細については後述します) Propshaft + importmap-railsデフォルトの選択肢。Node.jsが不要。トランスパイルを含め、複
September 6, 2021 Rails 7 will have three great answers to JavaScript in 2021+ Rails has been unapologetically full stack since the beginning. We've continuously sought to include ever-more default answers to all the major infrastructure questions posed by modern web development. From talking to a database, to sending and receiving emails, to connecting web sockets, to rendering HTML, to integrati
This version of Rails has been years in the conceptual making. It’s the fulfillment of a vision to present a truly full-stack approach to web development that tackles both the front- and back-end challenges with equal vigor. An omakase menu that includes everything from the aperitif to the dessert. This vision wasn’t possible even just a few years ago. We simply didn’t have the core technologies i
Ruby on Rails Advent Calendar 2021の枠が空いていたので、あとから登録しました はじめに 個人的なプロジェクトになりますが、僕が翻訳しているRSpecの入門書「Everyday Rails - RSpecによるRailsテスト入門」を2022年前半にRails 7.0バージョンにアップデートしようと考えています。 そこでこの本の中で使っているサンプルアプリケーションをRails 7.0でゼロから作り直してみました。フロントエンド周りを中心に結構考え方が変わっている部分があったので、「ここでハマった!」とか「こういうポイントを押さえておくといいかも」という点をあれこれ書いてみます。 なお、Rails 7.0版のサンプルアプリケーションはまだ公開できる状態ではないので、公開はもうしばらくお待ちください🙏 今回作成したサンプルアプリケーションはこちらで公開してい
Rails7のアルファ版がリリースされました。 最近、Railsニューリリースの記事をみてもテンションがあがらなかったのですが(個人開発ではもっぱらNext.jsとかFlutterのお世話になってました)、下記のDHHによるデモが久々に 「Railsっていいかも」 って思える内容だったので、背景も含めて解説します。 Railsの存在意義 みなさんは、どうやってRails使い始めましたか? 自分はRails3.1あたりで独学でウェブアプリ開発をはじめました。そのときに「簡単に始められて」「ビジネスロジックが増えても生産性が落ちない」 というあたりで、他に浮気する理由がなかった、というのが私の理由です。 それから数年が経ちますが、最近のRailsのアップデートは Basecamp(Railsの基となった製品)が必要としている機能がポートされているだけ という印象でした。 アプリケーションの複雑
この件、関連するPRやIssueが複数あってコメントも分散しており、人に説明するのがややこしいのでブログとしてまとめたものになります。間違いや意見などあったらコメントください! 追記(2023年08月02日) 7-0-stableブランチに今回の変更をrevertするコミットが入りました。挙動が変わって困った人が出たので一度元に戻して仕切り直しにする方針のようです。 [7-0-stable] Revert singular association breaking changes by zzak · Pull Request #48809 · rails/rails 7.0.7がいつリリースされるかはわかりませんが、今の状態でリリースされたら7.0.4の振る舞いに戻ることになります。7.0.5以降の変更で困っている人は一旦7-0-stableを指すようにすると良いかもしれません。 概要 Ra
こんにちは。マネーフォワード クラウド会計Plus (以下会計Plus)でエンジニアをしているぽっけです。 しばらく前に、会計PlusのRails 7へのアップグレードが完了しました。その中では様々な対応を行いましたが、この記事では特に印象的だったSTIとautoloadingの対応についてご紹介しようと思います。 STIとautoloadingは相性が悪いです。Rails 7以前は簡単な修正でこれらが共存して動いていましたが、Rails 7ではそのコードが動かなくなってしまいました。この問題は最終的には修正されましたが、それまでに紆余曲折あり修正までに何回ものPull Requestが必要になりました。 対象読者 Ruby on Railsを使用した開発経験があることを前提としています。また、STIやautoloadingについて詳細な説明はしません。それらを知らない場合は、該当するR
この記事は現時点(2021年04月28日)のrails/railsのmainブランチの最新のコミットでテストしています。 TL;DR invert_whereはすべてのwhereをinvertする 使い方によっては意図しない条件をinvertして危険 invert_whereとは invert_whereは、Rails 7でActiveRecord::Relationに追加される予定のメソッドです。 このメソッドは、relationにチェーンして呼び出すことで、それまでのwhereの条件を反転できます。 つまり次のようになります。(CHANGELOGから引用) class User scope :active, -> { where(accepted: true, locked: false) } end User.active # ... WHERE `accepted` = 1 AND
Hi everyone, I am happy to announce that Rails 7.0.1 has been released. The focus of this release is bring support to Ruby 3.1, released last Christmas (December 25, 2021). This release also brings a few bug fixes and documentation improvements. CHANGES since 7.0.0 To view the changes for each gem, please read the changelogs on GitHub: Action Cable CHANGELOG Action Mailbox CHANGELOG Action Mailer
Rails直球キャリアって? かつては「Railsだけを書く人」というと語弊があるかもしれませんが、とにかくRailsが軸になっている人が結構いた気がしていて(少なくとも自分の周りには)、本稿ではそんな人のキャリアをRails直球キャリアと呼んでみます。そんなRails直球キャリアの人が最近ではすっかり少なくなってしまったように感じます。 様々な要因があると思いますが、フロントエンドとバックエンドの分業が進んでいたり、また、組織としてTypeScript/JavaScriptで一貫してサーバとクライアントを書くという戦略を採っているところも見受けられます。後者について、Blitzをはじめ様々な野心的なフレームワークが散見されますが、今のところ支配的なものはないという印象です。 Rails7に高まる期待 その現在において、まだ見ぬRails7は技術選定の際に結構有力な選択肢に挙がるのではと密
Seven is the version of Rails I've been longing for. The one where all the cards are on the table. No more tricks up our sleeves. The culmination of years of progress on five different fronts at once. The backend gets some really nice upgrades, especially with the encryption work that we did for HEY, so your data can be encrypted while its live in the database. At-work encryption, as we call it on
Rails 7.0 RC1: New JavaScript Answers, At-Work Encryption, Query Origin Logging, Zeitwerk Exclusively We’re almost ready to declare Rails 7 done! The feedback since the first alpha release has been wonderful, we’ve eliminated a slew of issues, and we’ve seen Basecamp, HEY, GitHub, and Shopify all run in production on this alpha series. So we now feel so confident that this is nearly ready that we’
https://github.com/rails/rails/releases/tag/v7.0.5 割と非互換な変更が多いのでまとめておく has_one関連でのcreate_associationの挙動変更 https://github.com/rails/rails/pull/46386 のバックポートがさりげなくv7.0.5に入っている Supplier has_one Account (unique index付き) 既にaccountが登録されている際に「supplier.create_account!」を実行した時の挙動が変わる v7.0.4 ActiveRecord::RecordNotUnique 発生 v7.0.5 accountsがDELETE & INSERT される 同じ修正が原因だが、https://github.com/rails/rails/issues/4
Rails 7.0 Alpha 1: New JavaScript Answers, At-Work Encryption, Query Origin Logging, Zeitwerk Exclusively Welcome to the first alpha release of Rails 7. It brings some very exciting new answers to how we do JavaScript, an awesome approach to at-work encryption with Active Record, SQL query origin logging, asynchronous query loading, exclusive autoloading through Zeitwerk, and much more. We usually
概要 原著者の許諾を得て翻訳・公開いたします。 英語記事: Rails introduces new syntax for enum | Saeloun Blog 原文公開日: 2021年02月26日 著者: Deepak Mahakale サイト: Saeloun Blog | Ruby on Rails Consulting Company based in San Francisco and Boston Rails 7の最新の変更で、enum定義に新しい構文が導入されました(#41328)。 変更前 従来の構文では、以下のように「enumの名前」「enumの値」「enumのオプション」を渡せます。 class Post < ActiveRecord::Base enum status: [ :draft, :published, :archived ], _prefix: true,
The forthcoming Rails 7 represents a milestone for autoloading. There are two important changes coming: Zeitwerk has been the default autoloader for more than two years. Rails 6.0 and Rails 6.1 supported both zeitwerk and classic modes to help projects transition. This period ends with Rails 7: classic mode won’t be available anymore. Initializers can autoload reloadable constants if wrapped in to
2021年05月19日 Rails 7: has_many :through関連付けにdisable_joins: trueオプションが追加(翻訳) 私たちはRailsアプリケーションで、マルチプルデータベースを多用しています。Rails 6からマルチプルデータベースへの接続が簡単に行えるようになりました。 ここで以下のユースケースを考えてみましょう。 1人のユーザーは複数の記事(post)を作成できる 記事を見ているユーザーは誰でも記事にコメントを付けられる(いわゆるcroud-sourcedなコメント) この場合コメントが急速に増加する可能性があり、別の種類のデータ管理アプローチが必要になるかもしれないので、croud-sourcedなコメントを別のデータベースに保存することが考えられます。 この場合のdatabase.ymlは以下のようになるでしょう。 default: &defaul
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
Rails 7.0.2.3, 6.1.4.7, 6.0.4.7, and 5.2.6.3 have been released! Hi everyone! Rails 7.0.2.3, 6.1.4.7, 6.0.4.7, and 5.2.6.3 have been released! So many versions!!! Yes, this release is a security release, and you should update soon. The releases have been made from the last release tag, so hopefully upgrading will go smoothly. This release addresses CVE-2022-21831, and you can read more about that
The In-depth Guide to ActiveRecord load_async in Rails 7 Updated Mar 1, 2022 17 minute read Rails 7 introduces ActiveRecord load_async method that runs SQL queries asynchronously in the background thread. This seemingly simple change of just adding a single new method that takes no arguments has profound implications for database layer interactions. In this tutorial, we’ll deep dive into the intri
This story starts in October of 2019. I was in the Basecamp meetup in Chicago two weeks after joining the company. During an internal presentation, David talked about the need to raise the bar when it came to privacy for the new product the company was working on, codenamed Haystack, now HEY. We all were busy with all kinds of projects preparing for HEY launch, and I got in charge of the data priv
Swaathi Kakarla is a Ruby on Rails Developer specializing in building super-fast and secure web applications. Often there need to be multiple database queries executed in the controller like, @genres = Genre.all @videos = Video.order(published_at: :desc) These queries get executed sequentially which in most cases isn’t a big deal. However, as our database grows in size, response times get longer a
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く