Module: Redmineup::Patches::AutoCompletesControllerPatch
- Defined in:
- lib/redmineup/patches/auto_completes_controller_patch.rb
Constant Summary collapse
- DEFAULT_TAGS_LIMIT =
10
Instance Method Summary collapse
Instance Method Details
#taggable_tags ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/redmineup/patches/auto_completes_controller_patch.rb', line 6 def limit = params.delete(:limit) || DEFAULT_TAGS_LIMIT klass = Object.const_get(params[:taggable_type].camelcase) if params[:taggable_type].present? = klass && klass.(params.merge(limit: limit)) || Redmineup::ActsAsTaggable::Tag.limit(limit) render json: .map { |tag| { id: tag.name, text: tag.name } } end |