composite-primary-keys/composite_primary_keys — pull request #197 by seashell-qd (2014-05-15 02:16:44+00:00)
Title: Fix exception raised in method "id=" (same fix for #193 but for master branch since the buggy function was moved to the new file)

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$