Re: Attributes in classes db/migrate or app/models

Cortomix aa
2012-07-21T15:20:20Z

Thank you for your answer Hassan,

I explain my problem. If I''ve got a  Person class in my model, with
Rails I will have a class CreatePersons (for example) in db/migrate/
with its attributes (name, address, telephone...)

class CreatePersons< ActiveRecord::Migration
  def change
    create_table :persons do |t|
      t.string :name
      t.string :address
      .....

      t.timestamps
    end
  end
end



And I''ll have the class Person in app/models, but in this class, I
mustn''t put the attributes name, address...


class Persona < ActiveRecord::Base
end


If I work with the Person class, I will have a class without attributes
name or address!!

Is it right what I''ve told? Or, haven''t I understood de idea
in Rails?

Thanks!

--
Posted via http://www.ruby-forum.com/.