Skip to content

Instantly share code, notes, and snippets.

View papricek's full-sized avatar

Patrik Jíra papricek

  • http://www.patrikjira.com
  • Prague
View GitHub Profile
@zacstewart
zacstewart / anonymous_user.rb
Created October 2, 2012 17:35
Rails Soft Sign-Up
class AnonymousUser < User
attr_accessible *ACCESSIBLE_ATTRS, :type, :token, as: :registrant
def register(params)
params = params.merge(type: 'User', token: nil)
self.update_attributes(params, as: :registrant)
end
end