[obs-commits] [openSUSE/open-build-service] 18511b: [api] Make comment class polymorphic
Branch: refs/heads/master Home: https://github.com/openSUSE/open-build-service Commit: 18511b770e575cd4a4335d03ba5ff9e69dca6dd0 https://github.com/openSUSE/open-build-service/commit/18511b770e575cd4a4335d... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2016-11-29 (Tue, 29 Nov 2016) Changed paths: M src/api/app/models/bs_request.rb M src/api/app/models/comment.rb R src/api/app/models/comment_package.rb R src/api/app/models/comment_project.rb R src/api/app/models/comment_request.rb M src/api/app/models/package.rb M src/api/app/models/project.rb A src/api/db/migrate/20161115094035_add_commentable_to_comments.rb M src/api/db/structure.sql Log Message: ----------- [api] Make comment class polymorphic I introduced the migration and the relations needed to make the Comment model polymorphic. I eliminated the CommentPackage, CommentProject and CommentRequest models as they are not longer needed and I moved their methods to the Comment model. I also removed the check_is_child validation in Comment as it doesn't make sense now. Commit: 72c105cc08a7362335537891b548648dbc48f0d4 https://github.com/openSUSE/open-build-service/commit/72c105cc08a73623355378... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2016-11-29 (Tue, 29 Nov 2016) Changed paths: A src/api/db/migrate/20161122121211_move_comments_data.rb M src/api/db/structure.sql Log Message: ----------- [api] Migration to use the old comments Add a migration which moves all the comment's data to use the relatation instroduced in e34e4156b628c6f1c0307b961da9fa290bdf99c6 That allows to use the old comments. Note that comments are only save if all the data can me moved. If not the migration will fail. Commit: 5c1acdb2f5c943e605c2eece309adfcbfa68e181 https://github.com/openSUSE/open-build-service/commit/5c1acdb2f5c943e605c2ee... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2016-11-29 (Tue, 29 Nov 2016) Changed paths: A src/api/db/migrate/20161122123708_remove_old_relations_from_comments.rb M src/api/db/structure.sql Log Message: ----------- [api] Remove unused columns in comments table Remove the old relations and columns from the comments table, as after moving the data in 984b89c1303155c0eb663332861094e20f83494b they are not needed any more. Commit: 712437586c1fea06e2689314fab9c74d93b4593a https://github.com/openSUSE/open-build-service/commit/712437586c1fea06e26893... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2016-11-29 (Tue, 29 Nov 2016) Changed paths: M src/api/app/models/comment.rb Log Message: ----------- [api] Refactor Comment#involved_users Commit: 86d76618e808b84e3d0811ee8c4c39a71bee77b6 https://github.com/openSUSE/open-build-service/commit/86d76618e808b84e3d0811... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2016-11-30 (Wed, 30 Nov 2016) Changed paths: M src/api/test/fixtures/comments.yml M src/api/test/functional/webui/request_controller_test.rb M src/api/test/unit/comment_test.rb Log Message: ----------- [api] Fix old tests for new comments relations Fix old tests to use the new relations for comments. Commit: 0b6eee979965413b0241724241d50fe0ab68e4f8 https://github.com/openSUSE/open-build-service/commit/0b6eee979965413b024172... Author: Ana María Martínez Gómez <ammartinez@suse.de> Date: 2016-11-30 (Wed, 30 Nov 2016) Changed paths: R src/api/spec/factories/comment_packages.rb R src/api/spec/factories/comment_projects.rb R src/api/spec/factories/comment_requests.rb A src/api/spec/factories/comments.rb M src/api/spec/features/webui/comments_spec.rb M src/api/spec/mailers/event_mailer_spec.rb M src/api/spec/models/comment_spec.rb Log Message: ----------- [api] Fix Rspec for new comments relations Fix Rspec to use the new relations for comments. Commit: f31abc1726ca0142268cf94383faf377ae4ce550 https://github.com/openSUSE/open-build-service/commit/f31abc1726ca0142268cf9... Author: Henne Vogelsang <hvogel@opensuse.org> Date: 2016-11-30 (Wed, 30 Nov 2016) Changed paths: M src/api/app/models/bs_request.rb M src/api/app/models/comment.rb R src/api/app/models/comment_package.rb R src/api/app/models/comment_project.rb R src/api/app/models/comment_request.rb M src/api/app/models/package.rb M src/api/app/models/project.rb A src/api/db/migrate/20161115094035_add_commentable_to_comments.rb A src/api/db/migrate/20161122121211_move_comments_data.rb A src/api/db/migrate/20161122123708_remove_old_relations_from_comments.rb M src/api/db/structure.sql R src/api/spec/factories/comment_packages.rb R src/api/spec/factories/comment_projects.rb R src/api/spec/factories/comment_requests.rb A src/api/spec/factories/comments.rb M src/api/spec/features/webui/comments_spec.rb M src/api/spec/mailers/event_mailer_spec.rb M src/api/spec/models/comment_spec.rb M src/api/test/fixtures/comments.yml M src/api/test/functional/webui/request_controller_test.rb M src/api/test/unit/comment_test.rb Log Message: ----------- Merge pull request #2348 from Ana06/comment_polymorphic [api] Make comment class polymorphic Compare: https://github.com/openSUSE/open-build-service/compare/264b026bf9e7...f31abc...
participants (1)
-
Henne Vogelsang