app/models/unidom/contact/china/mobile_phone_number.rb in unidom-contact-china-1.1 vs app/models/unidom/contact/china/mobile_phone_number.rb in unidom-contact-china-1.1.1
- old
+ new
@@ -19,11 +19,12 @@
scope :network_identification_number_is, ->(network_identification_number) { where network_identification_number: network_identification_number }
scope :area_code_is, ->(area_code) { where area_code: area_code }
scope :serial_number_is, ->(serial_number) { where serial_number: phone_number }
before_validation do
- self.network_identification_number = self.phone_number[0..2]
- self.area_code = self.phone_number[3..6]
- self.serial_number = self.phone_number[7..10]
+ self.phone_number = phone_number.to_s
+ self.network_identification_number = phone_number[0..2]
+ self.area_code = phone_number[3..6]
+ self.serial_number = phone_number[7..10]
end
end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Contact::China::MobilePhoneNumber'