Class: RedminePluginsHelper::Migration
- Inherits:
-
Object
- Object
- RedminePluginsHelper::Migration
- Defined in:
- lib/redmine_plugins_helper/migration.rb,
lib/redmine_plugins_helper/migration/code.rb,
lib/redmine_plugins_helper/migration/database.rb
Defined Under Namespace
Constant Summary collapse
- PLUGIN_ID_CORE_VALUE =
:_core_
Instance Method Summary collapse
Instance Method Details
#applied? ⇒ Boolean
15 16 17 18 |
# File 'lib/redmine_plugins_helper/migration.rb', line 15 def applied? ::ActiveRecord::SchemaMigration.create_table ::ActiveRecord::SchemaMigration.where(version: database_version).any? end |
#core? ⇒ Boolean
26 27 28 |
# File 'lib/redmine_plugins_helper/migration.rb', line 26 def core? plugin_id == PLUGIN_ID_CORE_VALUE end |
#database_version ⇒ String
21 22 23 |
# File 'lib/redmine_plugins_helper/migration.rb', line 21 def database_version core? ? version.to_s : "#{version}-#{plugin_id}" end |
#plugin? ⇒ Boolean
31 32 33 |
# File 'lib/redmine_plugins_helper/migration.rb', line 31 def plugin? !core? end |