small medium large xlarge

Generic-user-small
08 Jul 2013, 03:09
Russell Harmon (4 posts)

The ‘digest’ field type doesn’t seem to exist as described in ‘14.1 Iteration I1: Adding Users’.

Using Rails 3.2.13: $ rails new digesting $ cd digesting/ $ rails generate scaffold User name:string password:digest $ rake db:migrate

results in: undefined method digest' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x007ff7412ddd00>/Library/WebServer/Documents/dev/digesting/db/migrate/20130708025111_create_users.rb:5:in block in change’

Looking at http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/TableDefinition.html#method-i-column and http://guides.rubyonrails.org/migrations.html#supported-types, I don’t see any documentation for this field type, nor can I find any reference to it with some quick googling.

Generic-user-small
08 Jul 2013, 03:10
Russell Harmon (4 posts)

stripped my urls: should be ‘looking at http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/TableDefinition.html#method-i-column and http://guides.rubyonrails.org/migrations.html#supported-types’

Samr_small_pragsmall
08 Jul 2013, 15:02
Sam Ruby (584 posts)

password:digest is a Rails 4 feature. What version of the book do you have?

Generic-user-small
09 Jul 2013, 17:24
Russell Harmon (4 posts)

Agile Web Development with Rails, 4th Edition (agile-web-development-with-rails.b2_0)

I’ve been avoiding ‘Agile Web Development with Rails 4’ (agile-web-development-with-rails-4.b4_0), since I’m still using 3.2. After the 3.0 -> 3.1 mess, I’m a little conservative.

Samr_small_pragsmall
12 Jul 2013, 14:23
Sam Ruby (584 posts)

b2 is for Rails 4 rc1; b4 is for Rails 4 final release; neither are for Rails 3.2.

Generic-user-small
12 Jul 2013, 16:17
Russell Harmon (4 posts)

Oho! I’d been keeping p3 around for this purpose, then apparently at some point glanced at b2 under the same title and assumed it was for the same Rails version. Thanks!

FWIW, finally biting the bullet and upgrading to Rails 4, so far pretty painless.

  You must be logged in to comment