Sha256: 4be43841f90f6c9f8ebe39ea43e9e3ff1387bb7d1b22e3b0fb19ce061ab43492

Contents?: true

Size: 639 Bytes

Versions: 7

Compression:

Stored size: 639 Bytes

Contents

class RegistrationSerializer < ActiveModel::Serializer
	include NullAttributeReplacer

	attributes :id, :dialing_prefix, :mobile_number, :status

 	has_one :user, class_name: "User", serializer: ProfileSerializer do
 		if object.user
      object.user
    else
      object.build_user
    end
 	end

 	has_one :country, class_name: "Country", serializer: CountryPreviewSerializer do
 		if object.country
      object.country
    else
      object.build_country
    end
 	end
 		
 	has_one :city, class_name: "City", serializer: CityPreviewSerializer do
 		if object.city
      object.city
    else
      object.build_city
    end
 	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
usman-0.3.12 app/serializers/registration_serializer.rb
usman-0.3.11 app/serializers/registration_serializer.rb
usman-0.3.10 app/serializers/registration_serializer.rb
usman-0.3.9 app/serializers/registration_serializer.rb
usman-0.3.8 app/serializers/registration_serializer.rb
usman-0.3.7 app/serializers/registration_serializer.rb
usman-0.3.6 app/serializers/registration_serializer.rb