Permalink
Browse files

Namepsace on create as well.

  • Loading branch information...
1 parent 83a3a66 commit be2e391d7b7c6ee840a4fc9fcc66402f4e820491 @waratuman waratuman committed May 28, 2013
Showing with 15 additions and 15 deletions.
  1. +15 −15 lib/mls/models/account.rb
View
@@ -1,28 +1,28 @@
class MLS::Account < MLS::Resource
- property :id, Fixnum
+ property :id, Fixnum, :serialize => false
property :type, String, :default => 'Account'
- property :name, String
- property :title, String
- property :email, String
+ property :name, String, :serialize => :if_present
+ property :title, String, :serialize => :if_present
+ property :email, String, :serialize => :if_present
property :password, String, :serialize => :if_present
property :password_confirmation, String, :serialize => :if_present
property :perishable_token, String, :serialize => false
property :perishable_token_set_at, String, :serialize => false
property :ghost, Boolean, :serialize => false, :default => false
- property :phone, String
+ property :phone, String, :serialize => :if_present
property :system_phone, String, :serialize => false
- property :company, String
- property :license, String
- property :linkedin, String
- property :twitter, String
- property :facebook, String
- property :web, String
+ property :company, String, :serialize => :if_present
+ property :license, String, :serialize => :if_present
+ property :linkedin, String, :serialize => :if_present
+ property :twitter, String, :serialize => :if_present
+ property :facebook, String, :serialize => :if_present
+ property :web, String, :serialize => :if_present
- property :city, String
- property :state, String
- property :country, String
+ property :city, String, :serialize => :if_present
+ property :state, String, :serialize => :if_present
+ property :country, String, :serialize => :if_present
property :created_at, DateTime, :serialize => :false
property :updated_at, DateTime, :serialize => :false
@@ -46,7 +46,7 @@ def update
# are any errors. @persisted will also be set to +true+ if the Account was
# succesfully created
def create
- MLS.post('/account', to_hash, 400) do |response, code|
+ MLS.post('/account', {:account => to_hash}, 400) do |response, code|
raise MLS::Exception::UnexpectedResponse if ![201, 400].include?(code)
MLS::Account::Parser.update(self, response.body)
@persisted = true

0 comments on commit be2e391

Please sign in to comment.