work
This commit is contained in:
@@ -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