2024-02-01ãã1ã¶æéã®è¨äºä¸è¦§
ã¯ããã« NotionRubyMapping 解説ã®ç¬¬6åç®ã§ããããã¾ã§è§£èª¬ãã¦ããä¸ã§ RichTextArray ã¨ãããã®ãé »ç¹ã«åºç¾ãã¦ãã¾ãããããã¯è¤æ°ã® RichText Object ãè¦ç´ ã«ãã¤ã¯ã©ã¹ã§ãããä»åã¯ãRichText Object ã®ãã¡ã®ä¸ã¤ã§ãã Text Object ã解説ãâ¦
NotionRubyMapping 解説ã®ç¬¬5åã§ã¯ã段è½ãããã¯ã®åå¾ã¨ããã«é¢é£ããã¡ã½ããã«ã¤ãã¦èª¬æããã¦ãã¾ãã主ã«ããããã¯ã®åå¾ãè²ã®å¤æ´ãåãããã¯ã®åå¾ãªã©ã®æ©è½ãç´¹ä»ããã¦ãã¾ãã(è¦ç´ by Notion AI)
ãã®è¨äºã¯NotionRubyMappingã®ç¬¬4åç®ã§ããã¼ã¿ãã¼ã¹ãåå¾ããæ¹æ³ã¨åå¾ãããã¼ã¿ãã¼ã¹ã«å¯¾ããã¡ã½ããã«ã¤ãã¦è§£èª¬ãã¦ãã¾ããå ·ä½çãªã³ã¼ãä¾ãå¼ç¨ããªãããåã¡ã½ããã®ä½¿ç¨æ³ã¨çµæã説æãã¦ãã¾ãã(è¦ç´ by Notion AI)
NotionRubyMapping解説ã®ç¬¬3åã§ã¯ããã¼ã¸ã¸ã®ã¢ã¯ã»ã¹ã¨ãã®ãã¼ã¸ãªãã¸ã§ã¯ãã¸ã®ã¡ã½ããã®ä½¿ç¨ã説æãã¦ãã¾ãããã¼ã¸ã¿ã¤ãã«ã親ã®IDã®åå¾ãã¢ã¤ã³ã³ã®è¨å®ãªã©ãå«ã¾ãã¾ãã(è¦ç´ by Notion AI)
第2åç®ã® NotionRubyMapping 解説ã§ã¯ãã¤ã³ãã°ã¬ã¼ã·ã§ã³ãã¼ã®ä½æã¨è¨å®ç¨ã¹ã¯ãªããã®ä½ãæ¹ã解説ãã¾ãããããã«ãããNotion ã® API ã Ruby ã§æä½ããæºåãæ´ãã¾ããã(è¦ç´ by Notion AI)
ããã¯NotionRubyMappingã®åå解説ã§ããNotionRubyMappingã¯Notion APIãRubyãã使ããããããã©ã¤ãã©ãªã§ãä»åã¯ãã®ã¤ã³ã¹ãã¼ã«æ¹æ³ã«ã¤ãã¦èª¬æãã¾ããã(è¦ç´ by Notion AI)
Rails ã® Tips ãæ¯æ¥æ¸ãã¦ãã¾ããããã ãããç 究室ã§ä½¿ããããªãã®ãå·çããã£ãã®ã§ãä»å¾ã¯ãã¿ãããæã«ä¸å®æã«é£è¼ãã¾ãã ææ¥ã®æããã¯å¥ã®é£è¼ãå§ãã¾ãã
RailsTips 第85åã§ã¯ãã³ã¡ã³ãã®è¿½å ã»ç·¨éã»åé¤ã®é¨åãTurboFrameåãããã¼ã¸é·ç§»ãªãã§æ´æ°ã§ããããã«ããæ¹æ³ãç´¹ä»ãã¦ãã¾ããã¾ããFlashã¡ãã»ã¼ã¸ãTurboFrameã§æ±ãããã®å·¥å¤«ã«ã¤ãã¦ãè¿°ã¹ã¦ãã¾ããTurboFrameã¯ä¸ç®æããæ´æ°ã§ããªããâ¦
RailsTipsã®84åç®ã§ã¯ãã¦ã¼ã¶ã¼é¢é£ã®ããã¤ãã®ä¸å ·åãä¿®æ£ãã¾ããããã°ã¤ã³ãã¦ããªãã¨ãã«æ°ããè¨äºãä½æã§ããªãããã«ãããã°ã¤ã³ãªã³ã¯ã追å ãã¾ãããã¾ããã¦ã¼ã¶ã¼ã®ååã空ã§ãã£ãåé¡ã解決ãã¾ãããã³ã¡ã³ãã®è¿½å ããã°ã¤ã³ãã¦ãâ¦
Rails Tips ã® 83 åç®ã§ã¯ãã¦ã¼ã¶ã¼ãã³ã¡ã³ãã«è¿½å ããæ¹æ³ãå¦ã³ã¾ãããã¢ãã«ã«ã¦ã¼ã¶ã¼ã追å ããå¾ãrequest spec ãä¿®æ£ããã³ã³ããã¼ã©ãæ£ããåä½ããããã«å¤æ´ãã¾ãããã¥ã¼ãåæ§ã«ä¿®æ£ããç¹ã« articles/comments/_form.html.haml 㨠artâ¦
RailsTipsã®82åç®ã¯ãã³ã¡ã³ãã«ãã¦ã¼ã¶ã¼ã追å ããæ¹æ³ã説æãã¦ãã¾ããè¨äºã¨åæ§ãã³ã¡ã³ãã«ãuser_idã追å ãã¾ãããã³ã¡ã³ãã®user_idã«ã¯nullã許å¯ããã¦ããç¹ãç°ãªãã¾ããããã¯ã¦ã¼ã¶ã¼ãåé¤ãããæã«ãã¦ã¼ã¶ã¼ãªãã®ã³ã¡ã³ããæ®ããâ¦
Rails Tipsã®81åç®ã§ã¯ãææããªããªãã¸ã§ã¯ãã«å¯¾ããç·¨éãåé¤ã®ãªã³ã¯ãçºçãããªãæ¹æ³ãç´¹ä»ãã¾ãããè¨äºã®å·çè ãåã«è¿½å ããeditã¨destroyã®ãªã³ã¯ã®åã«owned_by?ã§æ¨©éã確èªãããã¨ããã¤ã³ãã§ããã¾ããã¦ã¼ã¶é¢ä¿ã®å¦çãè¨äºã«é©ç¨â¦
RailsTips 80åç®ã§ã¯ãææ権ã確èªãããã¹ãããã³å®è£ ãè¡ãã¾ãããææããªããªãã¸ã§ã¯ãã«å¯¾ããeditã®å¯¾å¿ãæ¸ã¿ãupdateãdestroyã対å¿ãå®äºãã¦ãã¾ãããã¹ãã§å¯¾å¿ãæ¸ãã§ãããã¨ã確èªãã¾ãããææ¥ã¯ããã«åããã¦indexãªã©ã®æç»ãä¿®â¦
Rails Tipsã®79åç®ã§ã¯ãææããªããªãã¸ã§ã¯ãã«å¯¾ããç·¨éã®å¯¾å¿ãè¡ãã¾ãããææããªããªãã¸ã§ã¯ãã«å¯¾ããã¢ã¯ã»ã¹ãé²ããããè¨äºã®ææè ã確èªããã¡ã½ããã追å ãã¾ãããããã«ãããææ権ããªãå ´åã«ã¯ããããã¼ã¸ã«ãªãã¤ã¬ã¯ããã¾ãâ¦
Rails Tipsã®78åç®ã§ã¯ãè¨äºãç¹å®ã®ã¦ã¼ã¶ã¼ã®ææç©ãã©ããã確èªããã¡ã½ããowned_by?ã¨ãè¨äºãæ¸ããã¦ã¼ã¶ã¼ã®ååãåå¾ããã¡ã½ããuser_nameã®å®è£ ã¨ãã®ãã¹ãã«ã¤ãã¦è§£èª¬ãã¦ãã¾ããowned_by?ã¡ã½ããã¯ã¦ã¼ã¶ã¼IDã®æ¯è¼ãuser_nameã¡ã½ãâ¦
Rails Tips ã® 77 åç®ã§ã¯ãã¦ã¼ã¶ããã°ã¤ã³ããç¶æ ã§ã®ãã¹ããè¡ãã¾ãããã°ã¤ã³ç¶æ ã§ã¯ Devise::Test::IntegrationHelpers ã spec/rails_helper.rb ã«è¿½å ãããã°ã¤ã³ããããã®ã¡ã½ãããä½æãã¾ããè¨äºã®é²è¦§ã¯ãã°ã¤ã³ãã¦ããªãã¦ãå¯è½ã§ãâ¦
RailsTipsã®76åç®ã§ã¯ãRailsã¢ããªã±ã¼ã·ã§ã³ã«ã¦ã¼ã¶ã¼èªè¨¼ã追å ããæ¹æ³ã説æãã¦ãã¾ããDeviseãç¨ãã¦ãã¼ã«ã«èªè¨¼ã®ä½æãè¡ãããã®çµæã¨ãã¦ã¦ã¼ã¶ã¼ç»é²ãå¯è½ã«ãªãã¾ãããç¶ãã¦ãè¨äºã«ã¦ã¼ã¶ã¼IDå±æ§ã追å ãããã°ã¤ã³ããã¦ã¼ã¶ã¼ã ãâ¦
RailsTipsã®75åç®ã§ã¯ãOAuth2ã®èªè¨¼ã®ææ¦ã失æãããããä¸åº¦ãã¼ã«ã«ã®èªè¨¼ã«ç¦ç¹ãå½ã¦ã¦ãã¾ããgit revertã使ç¨ãã¦åæ¥ã®ä½æ¥ãåãæ¶ããdeviseã§ãã¼ã«ã«ãã°ã¤ã³ãå®è£ ãã¾ããã¾ããi18nãã¼ã¸ã§ã³ã追å ãã¦ãã¾ããdeviseã®ã¤ã³ã¹ãã¼ã«å¾ãâ¦
Rails Tips ã® 74 åç®ã§ã¯ãGoogle ã® OAuth èªè¨¼ã®å°å ¥ã«ã¤ãã¦è§£èª¬ãã¦ãã¾ããã¾ããGoogle Cloud ã§ããã¸ã§ã¯ããä½æããOAuth åæç»é¢ãã OAuth 2.0 ã¯ã©ã¤ã¢ã³ã ID ãä½æãã¾ãããã®æ å ±ã Rails ã® credentials ã«ç»é²å¾ãèªè¨¼é¢é£ã® gem ãâ¦
Rails Tipsã®73åç®ã§ã¯ãVisible moduleã®å°å ¥ã¨å®è£ ãè¡ããã¾ãããè¨äºã¨ã³ã¡ã³ãã®ä¸¡æ¹ã§ãã¹ããããarchived?ã¡ã½ããã¯ãstatusãarchivedã§ããã¨ãã«trueãè¿ãã¾ãããã®ã¡ã½ããã¯Visible moduleã«Mix-inããããã¹ããééãã¾ãããã¾ããrequâ¦
RailsTipsã®72åç®ã§ã¯ãstatuså±æ§ã«å¤éå®å¶ç´ãè¨å®ãã¾ããããã®å±æ§ã¯public, private, archivedã®ã¿è¨å®å¯è½ã§ãããããã¹ãããããã®å¤éå®å¶ç´ã¨ããshared exampleãä½æãã¾ãããã¾ããArticleã¨Commentã®modelã«ããããåå¨å¶ç´ã¨å¤éå®å¶ç´â¦
RailsTipsã®71åç®ã§ã¯ããconcernã使ããã«ã¤ãã¦å¦ã³ã¾ããã¾ããè¨äºã¨ã³ã¡ã³ãã®ä¸¡æ¹ã«ã¹ãã¼ã¿ã¹å±æ§ã追å ããããã®ãã¤ã°ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ãä½æãã¾ããã¹ãã¼ã¿ã¹ã«ã¯publicãprivateãarchivedããå ¥ãããã¨ãã§ãã¾ãããããã®ãã¹ãã¯æ¬¡åâ¦
ãã®RailsTipsã®70åç®ã§ã¯ãã³ã¡ã³ãåé¤æ©è½ã®ãã¹ãã¨å®è£ ãè¨è¿°ãã¾ããã¾ãã¯ã³ã¡ã³ãã表示ãã¦ããé¨åãã³ãã¬ã¼ãã«åé¤ãªã³ã¯ã追å ãããã®å¾ã«æ°è¦ãã©ã¼ã ã表示ãããªãããã«ãã¾ãã次ã«ãã¹ããè¨è¿°ããæå¾ã«åé¤å¦çãè¨è¿°ãã¾ããããã§â¦
RailsTipsã®69åç®ã§ã¯ãã³ã¡ã³ãã®ç·¨éæ©è½ã®ãã¹ãã¨å®è£ ã«ã¤ãã¦è¨è¿°ããã¦ãã¾ããè¨äºã§ã¯ãé¨åãã³ãã¬ã¼ãã®å¤æ´ãæ°è¦ã³ã¡ã³ãã®è¨å®ãæ°è¦ç¨ãã©ã¼ã ã¨æ´æ°ç¨ãã©ã¼ã ã®è¡¨ç¤ºå¶å¾¡ããã¹ãã®è¨è¿°ãå®è£ ã®è©³ç´°ã«ã¤ãã¦èª¬æããã¦ãã¾ããã¾ãã次åã¯â¦
RailsTipsã®68åç®ã§ã¯ãã³ã¡ã³ãã®è¿½å æ©è½ã®ãã¹ãã¨å®è£ ãè¡ãã¾ãããè¨äºã§ã¯ããã¹ãã±ã¼ã¹ã®ä½æã¨ãã®çµæã«åºã¥ãå®è£ ã詳ãã説æãã¦ãã¾ããå ·ä½çã«ã¯ãsubmitãã¿ã³ãæ¼ããã¨ãã«åä½ããcreateã¢ã¯ã·ã§ã³ã®ãã¹ããè¡ãããã®çµæãåºã« artâ¦
RailsTips 67ã§ã¯ãã³ã¡ã³ãã®ã¨ã©ã¼ã«å¯¾ãã対å¿ãæ¹åããããã®æ¹æ³ã説æãã¦ãã¾ããRailsã¬ã¤ãã®ã³ã¼ããæ¹è¯ããformã®é¨åãé¨åãã³ãã¬ã¼ãã«ãã¾ãããã¾ããã¨ã©ã¼ãçºçãããªãã¸ã§ã¯ããæ¨ã¦ãããªãããã«ãæ°è¦ãªãã¸ã§ã¯ããä½ã代ããã«â¦
RailsTips 66åç®ã§ã¯ãarticles/comments_controller.rbã追å ããæ¹æ³ã説æããã¦ãã¾ãããã®è¨äºã§ã¯ããã¹ãããã³ã³ããã¼ã©ã®ä½ææ¹æ³ã¨ãçæãããRequest specãæ¸ãæããæé ã詳ãã説æãã¦ãã¾ããã¾ããè¨äºã®æå¾ã§ã¯ãä»å¾ã®ã³ã¡ã³ãã®è¿½â¦
RailsTipsã®65åç®ã§ã¯ãComment ã¢ãã«ã«å¯¾ããã«ã¼ãã£ã³ã°è¨å®ãè¡ãã¾ãããRails ã¬ã¤ãã«å¾ããã³ã¡ã³ãã追å ããã³ã³ããã¼ã©ã®ããã®ã«ã¼ãã£ã³ã°ã追å ãã¾ããããã ããã¬ã¤ãã§ã¯ãã©ãããªã³ã³ããã¼ã©ã使ã£ã¦ãã¾ãããã«ã¼ãã£ã³ã°ã ãã§ãªâ¦
Rails Tips 第64åç®ã§ã¯ãComment ã¢ãã«ã®ãã¹ãã«ã¤ãã¦è¨è¼ãã¾ããã¾ãå±æ§ã«é¢ãããã¹ããå®æ½ããããããã®å±æ§ã«å¯¾ãã¦åå¨å¶ç´ã追å ãã¾ããã¾ããé¢é£æ§ã®ç¢ºèªã¨è¦ªã¢ãã«ã®åé¤æã«åã¢ãã«ãåé¤ããããã¨ã確èªãããã¹ããè¨è¿°ãã¾ããæå¾â¦
第63åã® RailsTips ã§ã¯ã第äºã®ã¢ãã«ã§ãã Comment ã¢ãã«ã®è¿½å ã«ã¤ãã¦èª¬æããã¦ãã¾ããæ°ãã«ä½æããã Comment ã¢ãã«ã¯ãArticle ã¢ãã«ã¸ã®åç §ãä¿æãã¾ããã¾ããcommenter 㨠body ã«ã¯ null: false ã追å ãã¦ãã¾ããããã«ãæåã§è¨è¿°â¦