Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # migracja
- class CreateUsers < ActiveRecord::Migration
- def self.up
- create_table "users", :force => true do |t|
- t.column :login, :string
- t.column :email, :string
- t.column :crypted_password, :string, :limit => 40
- t.column :salt, :string, :limit => 40
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- t.column :remember_token, :string
- t.column :remember_token_expires_at, :datetime
- # powyżej dostarczone przez plugin
- t.column :name, :string, :limit => 128, :null => false
- t.column :role, :string, :limit => 40
- end
- end
- def self.down
- drop_table "users"
- end
- end
- # klasy
- class User < ActiveRecord::Base
- # Klasa z RESTful Authentication
- end
- class Student < User
- end
- # consola
- >> s = Student.new(:login => "nowy", :name => "Nowe nazwisko", :email => "email@nowy.pl", :password => "hasło", :password_confirmation => "hasło")
- >> s.name
- => nil
Add Comment
Please, Sign In to add comment