saasbook

moviegoer_auth.rb

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