work
This commit is contained in:
@@ -14,8 +14,7 @@ class Comment < ActiveRecord::Base
|
||||
scope :hidden, lambda {|user| where("score < ?", user.comment_threshold)}
|
||||
scope :post_tag_match, lambda {|query| joins(:post).where("posts.tag_index @@ to_tsquery('danbooru', ?)", query)}
|
||||
|
||||
search_method :body_matches
|
||||
search_method :post_tag_match
|
||||
search_methods :body_matches, :post_tag_match
|
||||
|
||||
def initialize_creator
|
||||
self.creator_id = CurrentUser.user.id
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Note < ActiveRecord::Base
|
||||
attr_accessor :updater_id, :updater_ip_addr
|
||||
attr_accessor :updater_id, :updater_ip_addr, :html_id
|
||||
belongs_to :post
|
||||
belongs_to :creator, :class_name => "User"
|
||||
belongs_to :updater, :class_name => "User"
|
||||
@@ -11,10 +11,10 @@ class Note < ActiveRecord::Base
|
||||
after_save :update_post
|
||||
after_save :create_version
|
||||
validate :post_must_not_be_note_locked
|
||||
attr_accessible :x, :y, :width, :height, :body, :updater_id, :updater_ip_addr, :is_active, :post_id
|
||||
attr_accessible :x, :y, :width, :height, :body, :updater_id, :updater_ip_addr, :is_active, :post_id, :html_id
|
||||
scope :active, where("is_active = TRUE")
|
||||
scope :body_matches, lambda {|query| where("text_index @@ plainto_tsquery(?)", query.scan(/\S+/).join(" & "))}
|
||||
search_method :body_matches
|
||||
search_methods :body_matches
|
||||
|
||||
def presenter
|
||||
@presenter ||= NotePresenter.new(self)
|
||||
|
||||
Reference in New Issue
Block a user