Skip to content

Commit

Permalink
make sure user inits correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyschoenherr committed Nov 2, 2012
1 parent b5a1ff0 commit 3671088
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 5 additions & 0 deletions lib/parse/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ class Object < Hash

def initialize(class_name, data = nil)
@class_name = class_name
shared_initialize(data)
end

def shared_initialize(data = nil)
@op_fields = {}
if data
parse data
end
self
end

def uri
Expand Down
8 changes: 1 addition & 7 deletions lib/parse/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,10 @@ def self.reset_password(email)

def initialize(data = nil)
@class_name = Parse::Protocol::CLASS_USER

#stringify symbol keys
data["username"] = data[:username] if data[:username]
data["password"] = data[:password] if data[:password]

if data
parse data
end

self
shared_initialize(data)
end

def uri
Expand Down

0 comments on commit 3671088

Please sign in to comment.