From the archive

Pluralizing is not Perfect

Adding an s to the end of something does not necessarily make it plural.

I was running my specs in my Sinatra app and I kept seeing this error...

```ruby Failure/Error: gr.save(id,data) ActiveRecord::StatementInvalid: PG::Error: ERROR: relation "gamedata" does not exist LINE 4: WHERE a.attrelid = '"gamedata"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"gamedata"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum ```

The problem was in the pluralization. My migration name was Create_Gamedata. Using the convention I thought was correct, while writing my migration I used

```ruby create_table :gamedatas do |t| ```

from examples I had seen, it seemed that you should always just add an s.

That is where the problem lies. The word data is actually already plural. Here is a solution to this problem...

```ruby self.table_name = 'gamedatas' ```

In my gamedata model, I added the self.table_name = 'gamedatas' line to point to the right table.