OOZOU
ติดต่อเรา
Back to TIL
ruby

optional relation + RSpec w/shoulda-matchers

13 ตุลาคม 2563

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

ruby30 เมษายน 2564

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

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

ruby14 ตุลาคม 2563

Heredoc without interpolation

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

ruby13 ตุลาคม 2563

Automagical Intermediate-level Hashtables in Ruby

All intermediate-level hashtables will be created automagically

มีโปรเจกต์ในใจ?

เรายินดีรับฟังสิ่งที่คุณกำลังสร้าง

เริ่มต้นสนทนาhello@oozou.com
OOZOU Logo

กรุงเทพฯ · สิงคโปร์ · ฮ่องกง

X
Facebook
Instagram
LinkedIn

บริการ

  • พัฒนาเว็บ
  • AI และ Generative AI
  • พัฒนาแอปมือถือ
  • การวิเคราะห์และวิศวกรรมข้อมูล
  • ออกแบบ UI/UX และผลิตภัณฑ์
  • การเปลี่ยนแปลงทางดิจิทัล

บริษัท

  • เกี่ยวกับเรา
  • ร่วมงานกับเรา
  • บล็อก
  • เอกสารวิชาการ
  • กรณีศึกษา
  • Today I Learned
  • ติดต่อเรา

เพิ่มเติม

  • อุตสาหกรรม
  • ขอใบเสนอราคา
  • เครือข่ายพันธมิตร
© 2026 OOZOU สงวนลิขสิทธิ์
นโยบายความเป็นส่วนตัวจรรยาบรรณนโยบาย ABAC