OOZOU
お問い合わせ
Back to TIL
ruby

optional relation + RSpec w/shoulda-matchers

2020年10月13日

User 1 - 0..1 Laptop

  • Model
    a/m/user.rb
    has\_one :laptop
    

a/m/laptop.rb belongs_to :user, optional: true


- spec
  *ruby
  s/m/laptop\_spec.rb
  it \{ should belong\_to(:user).optional }*

More on ruby

ruby2021年4月30日

Allow pasting multiline ruby blocks in Pry when using leading dot notation

We use leading dot notation a lot now e.g.

ruby2020年10月14日

Heredoc without interpolation

Sometimes you want to use Ruby's Heredoc without interpolation ('#{....}'). You can do this by adding single dashes around your keyword:

ruby2020年10月13日

Automagical Intermediate-level Hashtables in Ruby

All intermediate-level hashtables will be created automagically

プロジェクトをお考えですか?

あなたが構築しているものについてお聞かせください。

会話を始めるhello@oozou.com
OOZOU Logo

バンコク · シンガポール · 香港

X
Facebook
Instagram
LinkedIn

サービス

  • ウェブ開発
  • AI・生成AIソリューション
  • モバイルアプリ開発
  • データ分析・エンジニアリング
  • UI/UXデザイン・プロダクトデザイン
  • デジタルトランスフォーメーション

会社情報

  • 会社概要
  • 採用情報
  • ブログ
  • ホワイトペーパー
  • 事例研究
  • Today I Learned
  • お問い合わせ

その他

  • 業界
  • 見積もりを取得
  • パートナーネットワーク
© 2026 OOZOU. All rights reserved.
プライバシーポリシー行動規範ABACポリシー