Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't auto-update TMDB poster images once set

  • Loading branch information...
commit dd205c5a9cb763c34c29c958cca2eb1bea16d459 1 parent a97eee5
@mislav authored
Showing with 9 additions and 1 deletion.
  1. +3 −0  app/models/movie.rb
  2. +6 −1 spec/models/movie_spec.rb
View
3  app/models/movie.rb
@@ -116,6 +116,9 @@ def tmdb_movie=(movie)
set_unless_locked(db_field, value) if value.present?
end
+ lock_value :poster_small_url if poster_small_url.present?
+ lock_value :poster_medium_url if poster_medium_url.present?
+
# same name properties
[:year, :runtime, :countries, :directors, :homepage].each do |property|
value = movie.send(property)
View
7 spec/models/movie_spec.rb
@@ -122,7 +122,7 @@ def collection
end
it "has locked values" do
- tmdb = OpenStruct.new name: "Mr. Nobody", year: 2010
+ tmdb = OpenStruct.new name: "Mr. Nobody", year: 2010, poster_cover: 'poster:/url'
netflix = OpenStruct.new title: "Mr Nobody", year: 2009
movie = build tmdb_movie: tmdb
@@ -130,6 +130,7 @@ def collection
movie.title.should == "Mr. Nobody"
movie.year.should == 2010
+ movie.poster_medium_url.should eq('poster:/url')
movie.netflix_title = netflix
movie.title.should == "Mr. Nobody"
@@ -137,6 +138,10 @@ def collection
movie.tmdb_movie = tmdb
movie.year.should == 2009
+
+ tmdb2 = OpenStruct.new poster_cover: 'poster:/other'
+ movie.tmdb_movie = tmdb2
+ movie.poster_medium_url.should eq('poster:/url')
end
it "refreshes Rotten info" do
Please sign in to comment.
Something went wrong with that request. Please try again.