Skip to content

Commit

Permalink
using Rose::DB::Object setup #2
Browse files Browse the repository at this point in the history
  • Loading branch information
harvested committed Mar 21, 2021
1 parent 2fbdd60 commit 154722d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/MyIMDB/Models/UsersMovies.pm
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package MyIMDB::Models::UsersMovies;
use Mojo::Base -strict;
use parent 'MyIMDB::Models::Object';

use strict;
use warnings;
__PACKAGE__->meta->setup(
table => 'users_movies',
columns => ['user_id', 'movie_id', 'rated', 'favorited'],
pk_columns => ['user_id', 'movie_id'],
);

use base 'MyIMDB::Models::Base';

__PACKAGE__->set_up_table('users_movies');

__PACKAGE__->has_a( user_id => 'MyIMDB::Models::Users');
__PACKAGE__->has_a( movie_id => 'MyIMDB::Models::Movies');
# __PACKAGE__->has_a( user_id => 'MyIMDB::Models::Users');
# __PACKAGE__->has_a( movie_id => 'MyIMDB::Models::Movies');

1;

0 comments on commit 154722d

Please sign in to comment.