ä»æ¥ã¯ Rails ã§ã®ãé¢é£ã¢ãã«ãã®ååã«ã¤ãã¦èããã æ§é ã¨ãã¦ã¯ãããªæãã ã»ã«ã¼ã (Room)ã«æå±ããã¦ã¼ã¶ã¼(User) ã»ã«ã¼ã (Room)ã§ã®ç®¡çè
権éãæã¤ã¦ã¼ã¶ã¼(User) ã©ã¡ãã®é¢é£ã N:N ã®é¢é£ããããã has_may ãªæãã ã§ãããããæã®å½åã£ã¦ Room ã¢ãã«ã¨ User ã¢ãã«ã ãã RoomUser ã¨ã UserRoom ã¨ãã£ã¦ããã¢ãã«ããã¼ãã«ãä½ããã¡ãªã®ã ããã©ãä»åã¯åæ§ã®å½¢æ
ã®é¢é£ã2ã¤ããã®ã§ã¡ãã£ã¨å¾®å¦ãªäºã«ãªãããã ã£ã¦ããããã¾ããã£ã¦ RoomUser ã¢ãã«ã£ã¦ãªãã ãããªãã®ã¢ãã«ã ããããã£ã¦æããªã®ã§ååãèããã ã«ã¼ã (Room)ã«æå±ããã¦ã¼ã¶ã¼(User) é¢é£ã¢ãã«ã®ãã¼ã¿ã¯å¤§æµ2ã¤ã®ãã£ã¼ã«ããæã£ã¦ããã Migration ãããããæãåºã㨠t.references :room
{{#tags}}- {{label}}
{{/tags}}