Plural to Singular conversion trouble in Rails Migrations?
- by Earlz
Hi, I'm a beginner at Ruby On Rails and am trying to get a migration to work with the name Priorities
So, here is the code I use in my migration:
class Priorities < ActiveRecord::Migration
def self.up
create_table :priorities do |t|
t.column :name, :string, :null => false, :limit => 32
end
Priority.create :name => "Critical"
Priority.create :name => "Major"
Priority.create :name => "Minor"
end
def self.down
drop_table :priorities
end
end
This results in the following error though:
NOTICE: CREATE TABLE will create implicit sequence "priorities_id_seq" for serial column "priorities.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "priorities_pkey" for table "priorities"
rake aborted!
An error has occurred, this and all later migrations canceled:
uninitialized constant Priorities::Priority
Is this some problem with turning ies to y for converting something plural to singular?