From 277e3a4fae322ff1444bbf0d4466b954f9ed1df1 Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Thu, 18 Jan 2024 22:30:32 +0000 Subject: [PATCH 01/13] Refactor devcontainer --- .devcontainer/devcontainer.json | 4 ++-- .devcontainer/post-create.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 15c047b..09de3d7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -42,7 +42,6 @@ // Add the IDs of extensions you want installed when the container is created. "extensions": [ - "rebornix.Ruby", "mtxr.sqltools", "mtxr.sqltools-driver-pg", "craigmaslowski.erb", @@ -53,7 +52,8 @@ "ms-azuretools.vscode-docker", "KoichiSasada.vscode-rdbg", "Serhioromano.vscode-gitflow", - "github.vscode-github-actions" + "github.vscode-github-actions", + "Shopify.ruby-extensions-pack" ], // Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index b194b73..38df9fb 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -6,7 +6,7 @@ if [ -f plugins/${PLUGIN_NAME}/Gemfile_for_test ] then cp plugins/${PLUGIN_NAME}/Gemfile_for_test plugins/${PLUGIN_NAME}/Gemfile fi -cp plugins/${PLUGIN_NAME}/test/fixtures/*.yml test/fixtures + ln -s /workspaces/${PLUGIN_NAME}/.devcontainer/launch.json .vscode/launch.json bundle install From 5cf0f707679fe942e1ba18eed4d8664998aeb68e Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Thu, 18 Jan 2024 22:45:32 +0000 Subject: [PATCH 02/13] update release action --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0dfe05f..a55fc14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,10 @@ jobs: run: | REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##") VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") - echo ::set-output name=version::$VERSION - echo ::set-output name=filename::$REPOSITORY-$VERSION - echo ::set-output name=plugin::$REPOSITORY - - uses: actions/checkout@v2 + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "filename=$REPOSITORY-$VERSION" >> $GITHUB_OUTPUT + echo "name=plugin=$REPOSITORY" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4 - name: Archive run: | cd ..; zip -r ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/ -x "*.git*"; mv ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/ From 36805b8b64511996f31b4f7b0a9c78654f997b1c Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Thu, 18 Jan 2024 23:02:05 +0000 Subject: [PATCH 03/13] fix release action --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a55fc14..6828ac6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,19 +18,19 @@ jobs: VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") echo "version=$VERSION" >> $GITHUB_OUTPUT echo "filename=$REPOSITORY-$VERSION" >> $GITHUB_OUTPUT - echo "name=plugin=$REPOSITORY" >> $GITHUB_OUTPUT + echo "plugin=$REPOSITORY" >> $GITHUB_OUTPUT - uses: actions/checkout@v4 - name: Archive run: | - cd ..; zip -r ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/ -x "*.git*"; mv ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/ + cd ..; zip -r ${{ env.filename }}.zip ${{ env.plugin }}/ -x "*.git*"; mv ${{ env.filename }}.zip ${{ env.plugin }}/ - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ steps.version.outputs.version }} - release_name: ${{ steps.version.outputs.version }} + tag_name: ${{ env.version }} + release_name: ${{ env.version }} body: '' draft: false prerelease: true @@ -41,6 +41,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.version.outputs.filename }}.zip - asset_name: ${{ steps.version.outputs.filename }}.zip + asset_path: ${{ env.filename }}.zip + asset_name: ${{ env.filename }}.zip asset_content_type: application/zip \ No newline at end of file From ac6d5eafa5586b3d00b6092fa6ab8e3b9747a344 Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Thu, 18 Jan 2024 23:14:21 +0000 Subject: [PATCH 04/13] fix relesae action --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6828ac6..2e1e05c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,9 @@ jobs: run: | REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##") VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "filename=$REPOSITORY-$VERSION" >> $GITHUB_OUTPUT - echo "plugin=$REPOSITORY" >> $GITHUB_OUTPUT + echo "version=$VERSION" >> $GITHUB_ENV + echo "filename=$REPOSITORY-$VERSION" >> $GITHUB_ENV + echo "plugin=$REPOSITORY" >> $GITHUB_ENV - uses: actions/checkout@v4 - name: Archive run: | From 86710fa73d2d2d43eed3145ebc9bfea5420aeb9e Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Fri, 19 Jan 2024 10:57:41 +0000 Subject: [PATCH 05/13] refactor build environment --- .devcontainer/devcontainer.json | 2 +- .devcontainer/plugin_generator.sh | 14 ++++++++++++++ .devcontainer/post-create.sh | 3 +-- .devcontainer/redmine.code-workspace | 11 +++++++++++ .github/workflows/release.yml | 26 ++++++-------------------- .redmine.code-workspace | 11 ----------- 6 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 .devcontainer/plugin_generator.sh create mode 100644 .devcontainer/redmine.code-workspace delete mode 100644 .redmine.code-workspace diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 09de3d7..708ddb3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/ruby-rails-postgres // Update the VARIANT arg in docker-compose.yml to pick a Ruby version { - "name": "Ruby on Rails & Postgres", + "name": "Redmine plugin", "dockerComposeFile": "docker-compose.yml", "service": "app", diff --git a/.devcontainer/plugin_generator.sh b/.devcontainer/plugin_generator.sh new file mode 100644 index 0000000..fa46913 --- /dev/null +++ b/.devcontainer/plugin_generator.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +cd `dirname $0` +cd .. +BASEDIR=`pwd` +PLUGIN_NAME=`basename $BASEDIR` +echo $PLUGIN_NAME + +cd $REDMINE_ROOT + +export RAILS_ENV="production" + +bundle exec rails generate redmine_plugin $PLUGIN_NAME \ No newline at end of file diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 38df9fb..c1c89f6 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,5 +1,5 @@ #!/bin/sh -cd /usr/local/redmine +cd $REDMINE_ROOT ln -s /workspaces/${PLUGIN_NAME} plugins/${PLUGIN_NAME} if [ -f plugins/${PLUGIN_NAME}/Gemfile_for_test ] @@ -7,7 +7,6 @@ then cp plugins/${PLUGIN_NAME}/Gemfile_for_test plugins/${PLUGIN_NAME}/Gemfile fi -ln -s /workspaces/${PLUGIN_NAME}/.devcontainer/launch.json .vscode/launch.json bundle install bundle exec rake redmine:plugins:migrate diff --git a/.devcontainer/redmine.code-workspace b/.devcontainer/redmine.code-workspace new file mode 100644 index 0000000..8690e21 --- /dev/null +++ b/.devcontainer/redmine.code-workspace @@ -0,0 +1,11 @@ +{ + "folders": [ + { + "path": ".." + }, + { + "path": "../../../usr/local/redmine" + } + ], + "settings": {} +} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e1e05c..19b1e40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,8 @@ on: - '**' tags: - '**' +permissions: + contents: write env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} jobs: @@ -23,24 +25,8 @@ jobs: - name: Archive run: | cd ..; zip -r ${{ env.filename }}.zip ${{ env.plugin }}/ -x "*.git*"; mv ${{ env.filename }}.zip ${{ env.plugin }}/ - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release + uses: softprops/action-gh-release@v1 with: - tag_name: ${{ env.version }} - release_name: ${{ env.version }} - body: '' - draft: false - prerelease: true - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ env.filename }}.zip - asset_name: ${{ env.filename }}.zip - asset_content_type: application/zip \ No newline at end of file + draft: true + files: ${{ env.filename }}.zip \ No newline at end of file diff --git a/.redmine.code-workspace b/.redmine.code-workspace deleted file mode 100644 index 51dc8f7..0000000 --- a/.redmine.code-workspace +++ /dev/null @@ -1,11 +0,0 @@ -{ - "folders": [ - { - "path": "." - }, - { - "path": "../../usr/local/redmine" - } - ], - "settings": {} -} \ No newline at end of file From 13f3676aaef2397d9421d7f0f460ce1c0e727010 Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 16 Nov 2024 07:40:08 +0900 Subject: [PATCH 06/13] pull from git when new devcontainer created. --- .devcontainer/post-create.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index c1c89f6..8c4aac8 100644 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,6 +1,13 @@ #!/bin/sh cd $REDMINE_ROOT +if [ -d .git.sv ] +then + mv -s .git.sv .git + git pull + rm .git +fi + ln -s /workspaces/${PLUGIN_NAME} plugins/${PLUGIN_NAME} if [ -f plugins/${PLUGIN_NAME}/Gemfile_for_test ] then @@ -9,8 +16,6 @@ fi bundle install -bundle exec rake redmine:plugins:migrate -bundle exec rake redmine:plugins:migrate RAILS_ENV=test initdb() { bundle exec rake db:create From 4ff4b06346c71aa4d5b34d968b1eb1a917a11628 Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 16 Nov 2024 07:40:31 +0900 Subject: [PATCH 07/13] refactor --- .devcontainer/devcontainer.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 708ddb3..675e75f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,5 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/ruby-rails-postgres -// Update the VARIANT arg in docker-compose.yml to pick a Ruby version +// Redmine plugin boilerplate +// version: 1.0.0 { "name": "Redmine plugin", "dockerComposeFile": "docker-compose.yml", @@ -10,7 +9,6 @@ "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind" ], "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", - // "workspaceFolder": "/workspaces/dev.code-workspace", // Set *default* container specific settings.json values on container create. "settings": { @@ -53,7 +51,8 @@ "KoichiSasada.vscode-rdbg", "Serhioromano.vscode-gitflow", "github.vscode-github-actions", - "Shopify.ruby-extensions-pack" + "Shopify.ruby-extensions-pack", + "ritwickdey.LiveServer" ], // Use 'forwardPorts' to make a list of ports inside the container available locally. From 6ff96f50c30f62fa3c8120cf126bd67a4c21accd Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 16 Nov 2024 01:38:32 +0000 Subject: [PATCH 08/13] Change devcontainer to Redmine 6.0 --- .devcontainer/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 21a0735..18eab42 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -9,10 +9,10 @@ services: # Update 'VARIANT' to pick a version of Ruby: 3, 3.0, 2, 2.7, 2.6 # Append -bullseye or -buster to pin to an OS version. # Use -bullseye variants on local arm64/Apple Silicon. - RUBY_VERSION: "3.1" + RUBY_VERSION: "3.2" # Optional Node.js version to install NODE_VERSION: "lts/*" - REDMINE_VERSION: "5.1-stable" + REDMINE_VERSION: "6.0-stable" # Overrides default command so things don't shut down after the process ends. command: sleep infinity From 03e1b62d399d1154a58e838b2b7dade6d5b852e1 Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 16 Nov 2024 01:44:27 +0000 Subject: [PATCH 09/13] Drop Redmine 4.2 and addd 6.0 to testing environment --- .github/workflows/build.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3840204..e9c92a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,6 @@ name: build on: push: - branches-ignore: pull_request: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} @@ -11,17 +10,19 @@ jobs: strategy: matrix: db: [sqlite3, mysql, postgres] - ruby_version: ["2.7", "3.0", "3.1", "3.2"] - redmine_version: [4.2-stable, 5.0-stable, 5.1-stable, master] + ruby_version: ["3.0", "3.1", "3.2", "3.3"] + redmine_version: [5.0-stable, 5.1-stable, master] exclude: - - ruby_version: "3.0" - redmine_version: 4.2-stable - - ruby_version: "3.1" - redmine_version: 4.2-stable - - ruby_version: "3.2" - redmine_version: 4.2-stable - ruby_version: "3.2" redmine_version: 5.0-stable + - ruby_version: "3.3" + redmine_version: 5.0-stable + - ruby_version: "3.3" + redmine_version: 5.1-stable + - ruby_version: "3.0" + redmine_version: 6.0-stable + - ruby_version: "3.0" + redmine_version: master services: mysql: image: mysql:5.7 From 68076b7e1a57ff73be1b782f94aa685cce547b45 Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 16 Nov 2024 02:01:20 +0000 Subject: [PATCH 10/13] remove factory_girl --- Gemfile_for_test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile_for_test b/Gemfile_for_test index 4d727d8..f830914 100644 --- a/Gemfile_for_test +++ b/Gemfile_for_test @@ -1,6 +1,6 @@ group :test do - gem 'factory_girl_rails' + # gem 'factory_girl_rails' #gem 'shoulda-matchers' gem 'shoulda' gem 'simplecov-lcov', :require => false From ebb6888bb1aeac30ceaf5938a2a1f61dfe210afd Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 16 Nov 2024 02:01:43 +0000 Subject: [PATCH 11/13] drop support fo redmine 4 & 5 --- .github/workflows/build.yml | 15 ++------------- init.rb | 4 ++-- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9c92a8..170861a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,19 +10,8 @@ jobs: strategy: matrix: db: [sqlite3, mysql, postgres] - ruby_version: ["3.0", "3.1", "3.2", "3.3"] - redmine_version: [5.0-stable, 5.1-stable, master] - exclude: - - ruby_version: "3.2" - redmine_version: 5.0-stable - - ruby_version: "3.3" - redmine_version: 5.0-stable - - ruby_version: "3.3" - redmine_version: 5.1-stable - - ruby_version: "3.0" - redmine_version: 6.0-stable - - ruby_version: "3.0" - redmine_version: master + ruby_version: ["3.1", "3.2", "3.3"] + redmine_version: [6.0-stable, master] services: mysql: image: mysql:5.7 diff --git a/init.rb b/init.rb index 2b2944e..b5e3b2f 100644 --- a/init.rb +++ b/init.rb @@ -1,5 +1,5 @@ # Wiki Extensions plugin for Redmine -# Copyright (C) 2009-2023 Haruyuki Iida +# Copyright (C) 2009-2024 Haruyuki Iida # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -43,7 +43,7 @@ description 'This is a Wiki Extensions plugin for Redmine' url 'http://www.r-labs.org/projects/r-labs/wiki/Wiki_Extensions_en' version '0.9.5' - requires_redmine :version_or_higher => '4.0.0' + requires_redmine :version_or_higher => '6.0.0' project_module :wiki_extensions do permission :wiki_extensions_vote, { :wiki_extensions => [:vote, :show_vote] }, :public => true From bad8c5d7289b40306491d3d9b9e668eddf0759bc Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 16 Nov 2024 02:06:09 +0000 Subject: [PATCH 12/13] Change ActiveRecord::Base to ApplicationRecord --- app/models/wiki_extensions_comment.rb | 2 +- app/models/wiki_extensions_count.rb | 2 +- app/models/wiki_extensions_menu.rb | 2 +- app/models/wiki_extensions_setting.rb | 2 +- app/models/wiki_extensions_tag.rb | 2 +- app/models/wiki_extensions_tag_relation.rb | 2 +- app/models/wiki_extensions_vote.rb | 3 +-- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/models/wiki_extensions_comment.rb b/app/models/wiki_extensions_comment.rb index 0158a19..1e1542d 100644 --- a/app/models/wiki_extensions_comment.rb +++ b/app/models/wiki_extensions_comment.rb @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -class WikiExtensionsComment < ActiveRecord::Base +class WikiExtensionsComment < ApplicationRecord belongs_to :user belongs_to :wiki_page validates_presence_of :comment, :wiki_page_id, :user_id diff --git a/app/models/wiki_extensions_count.rb b/app/models/wiki_extensions_count.rb index ae3e386..4204d2a 100644 --- a/app/models/wiki_extensions_count.rb +++ b/app/models/wiki_extensions_count.rb @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -class WikiExtensionsCount < ActiveRecord::Base +class WikiExtensionsCount < ApplicationRecord belongs_to :project belongs_to :page, :foreign_key => :page_id, :class_name => 'WikiPage' validates_presence_of :project diff --git a/app/models/wiki_extensions_menu.rb b/app/models/wiki_extensions_menu.rb index 662faa7..5edb92a 100644 --- a/app/models/wiki_extensions_menu.rb +++ b/app/models/wiki_extensions_menu.rb @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -class WikiExtensionsMenu < ActiveRecord::Base +class WikiExtensionsMenu < ApplicationRecord include Redmine::SafeAttributes belongs_to :project validates_presence_of :project_id diff --git a/app/models/wiki_extensions_setting.rb b/app/models/wiki_extensions_setting.rb index 2648938..4e7b0b4 100644 --- a/app/models/wiki_extensions_setting.rb +++ b/app/models/wiki_extensions_setting.rb @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -class WikiExtensionsSetting < ActiveRecord::Base +class WikiExtensionsSetting < ApplicationRecord belongs_to :project #attr_accessible :auto_preview_enabled, :tag_disabled diff --git a/app/models/wiki_extensions_tag.rb b/app/models/wiki_extensions_tag.rb index 8632b0f..351c336 100644 --- a/app/models/wiki_extensions_tag.rb +++ b/app/models/wiki_extensions_tag.rb @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -class WikiExtensionsTag < ActiveRecord::Base +class WikiExtensionsTag < ApplicationRecord #attr_accessible :name, :project_id validates_presence_of :name, :project_id validates_uniqueness_of :name, :scope => :project_id diff --git a/app/models/wiki_extensions_tag_relation.rb b/app/models/wiki_extensions_tag_relation.rb index e6c1412..1df76f1 100644 --- a/app/models/wiki_extensions_tag_relation.rb +++ b/app/models/wiki_extensions_tag_relation.rb @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -class WikiExtensionsTagRelation < ActiveRecord::Base +class WikiExtensionsTagRelation < ApplicationRecord belongs_to :wiki_page belongs_to :tag, :class_name => 'WikiExtensionsTag', :foreign_key => :tag_id validates_presence_of :wiki_page_id, :tag_id diff --git a/app/models/wiki_extensions_vote.rb b/app/models/wiki_extensions_vote.rb index 8e7105c..94e968a 100644 --- a/app/models/wiki_extensions_vote.rb +++ b/app/models/wiki_extensions_vote.rb @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -class WikiExtensionsVote < ActiveRecord::Base +class WikiExtensionsVote < ApplicationRecord validates_presence_of :target_class_name, :target_id, :keystr, :count validates_uniqueness_of :keystr, :scope => [:target_class_name, :target_id] @@ -48,4 +48,3 @@ def self.find_or_create(class_name, obj_id, key_str) return vote end end - \ No newline at end of file From 6610dc01d679951741310204941fbeb77a0b4786 Mon Sep 17 00:00:00 2001 From: Haruyuki Iida Date: Sat, 16 Nov 2024 02:24:56 +0000 Subject: [PATCH 13/13] change version to 1.0.0 --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index b5e3b2f..dd8569d 100644 --- a/init.rb +++ b/init.rb @@ -42,7 +42,7 @@ author_url 'http://twitter.com/haru_iida' description 'This is a Wiki Extensions plugin for Redmine' url 'http://www.r-labs.org/projects/r-labs/wiki/Wiki_Extensions_en' - version '0.9.5' + version '1.0.0' requires_redmine :version_or_higher => '6.0.0' project_module :wiki_extensions do