Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisenator committed Oct 19, 2014
2 parents 56f59d0 + c968a57 commit dc379b0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
22 changes: 21 additions & 1 deletion app/controllers/movies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,27 @@ def show
details = fetch_details(imdb_id)[:movie]
@movie = Movie.new(
title: details.title,
imdb_id: details.imdb_id
imdb_id: details.imdb_id,
year: details.year,
movie_type: details.type,
rated: details.rated,
released: details.released,
runtime: details.runtime,
genre: details.genre,
director: details.director,
writer: details.writer,
actors: details.actors,
plot: details.plot,
poster: details.poster,
imdb_rating: details.imdb_rating,
imdb_votes: details.imdb_votes,
metascore: details.metascore,
language: details.language,
country: details.country,
awards: details.awards,
tomato_rating: details.tomato_rating,
production: details.production,
website: details.website
)
@movie.save!
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/movie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# title :string(255)
# year :integer
# imdb_id :string(255)
# type :string(255)
# rated :string(255)
# released :date
# runtime :string(255)
Expand All @@ -27,6 +26,7 @@
# website :string(255)
# created_at :datetime
# updated_at :datetime
# movie_type :string(255)
#

class Movie < ActiveRecord::Base
Expand Down
6 changes: 6 additions & 0 deletions db/migrate/20141019051204_remove_type_from_movie.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class RemoveTypeFromMovie < ActiveRecord::Migration
def change
remove_column :movies, :type, :string
add_column :movies, :movie_type, :string
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
t.string "title"
t.integer "year"
t.string "imdb_id"
t.string "type"
t.string "rated"
t.date "released"
t.string "runtime"
Expand All @@ -50,6 +49,7 @@
t.string "website"
t.datetime "created_at"
t.datetime "updated_at"
t.string "movie_type"
end

create_table "user_movie_joins", force: true do |t|
Expand Down

0 comments on commit dc379b0

Please sign in to comment.