composite-primary-keys/composite_primary_keys — pull request #193 by seashell-qd (2014-04-29 05:25:56+00:00)
Title: Fix exception raised in method "id=" (Rails 4.0.x)

Below exception was raised.
lib/composite_primary_keys/composite_arrays.rb:19:in `parse': Unsupported type: 0 (ArgumentError)

It's because new_id 0 was returned in below code.

74 def create_record(attribute_names = nil)$
75 record_timestamps!$
76 attribute_names ||= keys_for_partial_write$
77 attributes_values = arel_attributes_with_values_for_create(attribute_names)$
78
79 new_id = self.class.unscoped.insert attributes_values$
80 self.id = new_id if self.class.primary_key$