Branch: refs/heads/master
Home: https://github.com/openSUSE/open-build-service
Commit: b1c58406ab45b98b2c5cc39f8c416655a7ddb694
https://github.com/openSUSE/open-build-service/commit/b1c58406ab45b98b2c5cc3...
Author: Ana María Martínez Gómez
Date: 2016-10-24 (Mon, 24 Oct 2016)
Changed paths:
M src/api/app/models/comment.rb
Log Message:
-----------
[api][webui] Add validation for Comment type
The column `type` of Comment is reserved for storing the class in case
of inheritance and it is `nil` otherwise. As we validate that it is
present, it can not be `nil`. So that means that it is not possible to
create a Comment directly, only instances of Comment children can be
created. In case that we try to create an Comment directly with a non
`nil` type which is not a name of any of the Comment children an
ActiveRecord::SubclassNotFound is raised in the database level.
It is not obvious that an instance of Comment can not be directly
created and that the type is used for the single table inheritance.
It is also a good idea to check it in a Rails validation.
Commit: 73187f702ccb221b093ca7a5f0384c145e1d37c9
https://github.com/openSUSE/open-build-service/commit/73187f702ccb221b093ca7...
Author: Björn Geuken
Date: 2016-10-25 (Tue, 25 Oct 2016)
Changed paths:
M src/api/app/models/comment.rb
Log Message:
-----------
Merge pull request #2252 from Ana06/abstract_class
[api][webui] Add validation for Comment type
Compare: https://github.com/openSUSE/open-build-service/compare/104bba911a6e...73187f...