Skip to content

Commit

Permalink
Remove Person validation on tmdb_id and rely on database index
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Oct 9, 2024
1 parent 2ba1395 commit 42d6532
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
primary_abstract_class

protected
def tmdb_image(path, version="original")
Expand Down
3 changes: 1 addition & 2 deletions app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class Person < ApplicationRecord

scope :alphabetical, -> { order(name: :asc) }

validates :name, presence: true
validates :tmdb_id, presence: true, uniqueness: true
validates :name, :tmdb_id, presence: true

enum gender: { "Not specified" => 0, "Female" => 1, "Male" => 2, "Non-Binary" => 3 }

Expand Down

0 comments on commit 42d6532

Please sign in to comment.