mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-15 03:38:08 +01:00
Merge remote-tracking branch 'origin/master' into bug/#2259_charts_quality
This commit is contained in:
commit
f7bad05dad
20 changed files with 205 additions and 101 deletions
|
|
@ -712,9 +712,8 @@ class TodosController < ApplicationController
|
|||
|
||||
|
||||
def tags
|
||||
# TODO: limit to current_user
|
||||
tags_beginning = Tag.where(Tag.arel_table[:name].matches("#{params[:term]}%"))
|
||||
tags_all = Tag.where(Tag.arel_table[:name].matches("%#{params[:term]}%"))
|
||||
tags_beginning = current_user.tags.where(Tag.arel_table[:name].matches("#{params[:term]}%"))
|
||||
tags_all = current_user.tags.where(Tag.arel_table[:name].matches("%#{params[:term]}%"))
|
||||
tags_all = tags_all - tags_beginning
|
||||
|
||||
respond_to do |format|
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ module TodosHelper
|
|||
end
|
||||
|
||||
def context_container_id(todo)
|
||||
return "c#{todo.context_id}"
|
||||
return "context_#{todo.context_id}"
|
||||
end
|
||||
|
||||
def todo_container_id(todo)
|
||||
|
|
|
|||
|
|
@ -3,13 +3,15 @@ class Tag < ApplicationRecord
|
|||
has_many :taggings
|
||||
has_many :taggable, :through => :taggings
|
||||
|
||||
belongs_to :user
|
||||
|
||||
DELIMITER = ",".freeze # Controls how to split and join tagnames from strings. You may need to change the <tt>validates_format_of parameters</tt> if you change this.
|
||||
JOIN_DELIMITER = ", ".freeze
|
||||
|
||||
# If database speed becomes an issue, you could remove these validations and
|
||||
# rescue the ActiveRecord database constraint errors instead.
|
||||
validates_presence_of :name
|
||||
validates_uniqueness_of :name, :case_sensitive => false
|
||||
validates_uniqueness_of :name, :scope => "user_id", :case_sensitive => false
|
||||
|
||||
before_create :before_create
|
||||
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ class User < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
has_many :tags, dependent: :delete_all
|
||||
has_many :notes, -> { order "created_at DESC" }, dependent: :delete_all
|
||||
has_one :preference, dependent: :destroy
|
||||
has_many :attachments, through: :todos
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue