LOGIN

Tagged entries: "ruby"

I was fiddling with migrations, and found these regarding the use of MySQL-ish ENUMs in Migrations:

Basically, ENUMs aren't supported, and using Validations might be a good work-around, but is dependent on you putting (and keeping) all of the logic in your Rails app. If you need to go cross-app (with some other thing that ain't rails), then use CHECK or other DB constraints to enforce desired values.

posted by erin at 02:48 PM on 29 December 2006  tag in del.icio.us Digg!
tags: ruby / rails / data types
 

I am quite sure someone has already found this simple solution, but when I poked around, I couldn't find it.

Here is my snippet to print out the error messages resulting from a validation as a flash notice:

  if @user.save 
    flash[:'notice'] = "New user saved successfully."  
  elsif !@user.errors.empty?
    flash[:'notice'] = "Could not save new user: " 
        << @user.errors.full_messages.join("; " ;) 
  end
posted by erin at 06:43 PM on 11 July 2006  tag in del.icio.us Digg!
tags: ruby / rails
 

So. I'm fiddling. again. with Ruby on Rails. because it's trendy.

I have to say, it's also handy. Very nice not to have to write the entire DB framework just to make an app! The problem that I have is I'm such a habitual programming dork that I find Ruby's syntax a little odd...

» Read More

posted by erin at 01:53 PM on 05 March 2006  tag in del.icio.us Digg!
tags: ruby / rails