Module: RedmineActsAsTaggableOn::RedminePluginPatch
- Defined in:
- lib/redmine_acts_as_taggable_on/redmine_plugin_patch.rb
Instance Method Summary collapse
- #requires_acts_as_taggable_on ⇒ Object
- #requires_acts_as_taggable_on? ⇒ Boolean
- #using_acts_as_taggable_on_tables? ⇒ Boolean
Instance Method Details
#requires_acts_as_taggable_on ⇒ Object
2 3 4 5 6 7 |
# File 'lib/redmine_acts_as_taggable_on/redmine_plugin_patch.rb', line 2 def requires_acts_as_taggable_on @requires_acts_as_taggable_on = true if Redmine::VERSION::MAJOR < 2 fail 'redmine_acts_as_taggable_on requires Redmine 2.x or higher.' end end |
#requires_acts_as_taggable_on? ⇒ Boolean
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/redmine_acts_as_taggable_on/redmine_plugin_patch.rb', line 9 def requires_acts_as_taggable_on? return true if @requires_acts_as_taggable_on # Safety net: If the plugin uses the acts-as-taggable-on gem the old way, # assume that it requires the tables. if File.exist?(gemfile_path) if File.read(gemfile_path).include? 'acts-as-taggable-on' warn_about_acts_as_taggable_on return true end end false end |
#using_acts_as_taggable_on_tables? ⇒ Boolean
24 25 26 27 28 |
# File 'lib/redmine_acts_as_taggable_on/redmine_plugin_patch.rb', line 24 def using_acts_as_taggable_on_tables? return false unless requires_acts_as_taggable_on? return false if Redmine::Plugin::Migrator.current_version(self) == 0 true end |