class Comment

Attributes

body[RW]
id[R]
post_id[R]
relevances[RW]

Public Class Methods

all_as_method() click to toggle source
# File activerecord/test/models/comment.rb, line 51
def self.all_as_method
  all
end
greeting() click to toggle source

Should not be called if extending modules that having the method exists on an association.

# File activerecord/test/models/comment.rb, line 39
def self.greeting
  raise
end
new(id = nil, post_id = nil) click to toggle source
# File actionpack/test/lib/controller/fake_models.rb, line 66
def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end
search_by_type(q) click to toggle source
# File activerecord/test/models/comment.rb, line 47
def self.search_by_type(q)
  where("#{QUOTED_TYPE} = ?", q)
end
what_are_you() click to toggle source
# File activerecord/test/models/comment.rb, line 43
def self.what_are_you
  "a comment..."
end

Public Instance Methods

name() click to toggle source
# File actionpack/test/lib/controller/fake_models.rb, line 71
def name
  @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
end
persisted?() click to toggle source
# File actionpack/test/lib/controller/fake_models.rb, line 69
def persisted?; @id.present? end
relevances_attributes=(attributes) click to toggle source
# File actionpack/test/lib/controller/fake_models.rb, line 76
def relevances_attributes=(attributes); end
save() click to toggle source
# File actionpack/test/lib/controller/fake_models.rb, line 68
def save; @id = 1; @post_id = 1 end
to_key() click to toggle source
# File actionpack/test/lib/controller/fake_models.rb, line 67
def to_key; id ? [id] : nil end
to_param() click to toggle source
# File actionpack/test/lib/controller/fake_models.rb, line 70
def to_param; @id.to_s; end
to_s() click to toggle source
# File activerecord/test/models/comment.rb, line 56
def to_s
  body
end