Class: WorldTopMovies::DB::UserNote

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/world_top_movies/models/user_note.rb

Class Method Summary collapse

Class Method Details

.delete_note_record_from_user(user:, note_id:) ⇒ Object



5
6
7
8
# File 'lib/world_top_movies/models/user_note.rb', line 5

def self.delete_note_record_from_user(user:, note_id:)
  self.joins(:user, :note)
    .where("notes.id" => note_id, "users.username" => user.username).destroy_all
end