saasbook

moviegoer_auth.rb

Sep 15th, 2014
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.32 KB | None | 0 0
  1. # Edit app/models/moviegoer.rb to look like this:
  2. class Moviegoer < ActiveRecord::Base
  3.   attr_accessible :uid, :provider, :name # see text for explanation
  4.   def self.create_with_omniauth(auth)
  5.     Moviegoer.create!(
  6.       :provider => auth["provider"],
  7.       :uid => auth["uid"],
  8.       :name => auth["info"]["name"])
  9.   end
  10. end
Add Comment
Please, Sign In to add comment