class GeneratedMethodsTest

Public Instance Methods

test_association_methods_override_attribute_methods_of_same_name() click to toggle source
# File activerecord/test/cases/associations_test.rb, line 345
def test_association_methods_override_attribute_methods_of_same_name
  assert_equal(developers(:david), computers(:workstation).developer)
  # this next line will fail if the attribute methods module is generated lazily
  # after the association methods module is generated
  assert_equal(developers(:david), computers(:workstation).developer)
  assert_equal(developers(:david).id, computers(:workstation)[:developer])
end
test_included_module_overwrites_association_methods() click to toggle source
# File activerecord/test/cases/associations_test.rb, line 367
def test_included_module_overwrites_association_methods
  assert_equal :none, MyArticle.new.comments
end
test_model_method_overrides_association_method() click to toggle source
# File activerecord/test/cases/associations_test.rb, line 353
def test_model_method_overrides_association_method
  assert_equal(comments(:greetings).body, posts(:welcome).first_comment)
end