Made ActiveRecord::isPrimaryKey() public

+ added tests and fixed behavior