Skip to content

Commit

Permalink
Set primary key with id= only if primary key exists
Browse files Browse the repository at this point in the history
  • Loading branch information
guilleiguaran committed Sep 17, 2012
1 parent 2d7ae1b commit 3919fcd
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -18,7 +18,7 @@ def id


# Sets the primary key value # Sets the primary key value
def id=(value) def id=(value)
write_attribute(self.class.primary_key, value) write_attribute(self.class.primary_key, value) if self.class.primary_key
end end


# Queries the primary key value # Queries the primary key value
Expand Down

0 comments on commit 3919fcd

Please sign in to comment.