-__PACKAGE__->has_many(
- "messages",
- "Chatty::Schema::Result::Message",
- { "foreign.author" => "self.id" },
- { cascade_copy => 0, cascade_delete => 0 },
+__PACKAGE__->belongs_to(
+ "current_room",
+ "Chatty::Schema::Result::Room",
+ { id => "current_room" },
+ {
+ is_deferrable => 1,
+ join_type => "LEFT",
+ on_delete => "CASCADE",
+ on_update => "CASCADE",
+ },