Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8640063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:11:13+00:00 2026-06-12T11:11:13+00:00

app/models/zombie.rb class Zombie < ActiveRecord::Base attr_accessible :name validates :name, presence: true end spec/models/zombie_spec.rb require

  • 0

app/models/zombie.rb

class Zombie < ActiveRecord::Base
    attr_accessible :name
    validates :name, presence: true
end

spec/models/zombie_spec.rb

require 'spec_helper'

describe Zombie do

    it "is invalid without a name" do
        zombie = Zombie.new
        zombie.should_not be_valid
    end
end

errors

Zombie
is invalid without a name (FAILED – 1)
Failures:

 1) Zombie is invalid without a name
    Failure/Error: zombie.should_not be_valid
    ActiveRecord::StatementInvalid:
      Could not find table 'zombies'
    # ./spec/models/zombie_spec.rb:5:in `new'
    # ./spec/models/zombie_spec.rb:5:in `block (2 levels) in <top (required)>'

Finished in 0.02912 seconds
7 examples, 1 failure

Failed examples:

rspec ./spec/models/zombie_spec.rb:4 # Zombie is invalid without a name

Randomized with seed 12906

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:11:15+00:00Added an answer on June 12, 2026 at 11:11 am

    Thanks everyone, I was not running migrations so running rake db:migrate fixed it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is in Ruby 1.9.3p194, with Rails 3.2.8 app/models/owner.rb: class Owner < ActiveRecord::Base attr_accessible
I have the following: app/models/order.rb class Order < ActiveRecord::Base belongs_to :client accepts_nested_attributes_for :client end
If my models look like this: (app/models/letter.rb) class Letter < ActiveRecord::Base def cyrilic_equivilent #
I have the following code: # app/models/part.rb class Part < ActiveRecord::Base has_many :lots #
module App::Models class Team < Base has_many :players [...] end class Player < Base
Background I'm attempting to test my models. app/models/user.rb class User < ActiveRecord::Base has_many :payor_transactions,
Here is what I'm trying: app/models/product.rb class Product < ActiveRecord::Base class << self def
I have the following models. # app/models/domain/domain_object.rb class Domain::DomainObject < ActiveRecord::Base has_many :links_from, :class_name
Here is the structure I'm working with: app/models/model.rb class Model < ActiveRecord::Base attr_accessor :some_var
Here's part of my Django app's models.py : class Person(models.Model): birth_year = WideYear(null=True, blank=True)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.