Displaying 2 results from an estimated 2 matches for "validate_unique".
2009 Apr 21
2
problem with sqlite3....
...I created a simple db class
named user by using the below command
-> ruby script/generate model user
so in db/migrate I got a file named 20090421211825_create_users.rb
created.
and in app/models : user.rb got created.
in user.rb.. i have written like this
class User < ActiveRecord::Base
validate_uniqueness :userid
validate_presence_of :username
end
in 20090421211825_create_users.rb, its like this
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.integer :userid
t.string :username, :limit => 32
t.timestamps
end
end
def s...
2009 Nov 13
3
Encoding::UTF_8 missing?
...7/lib/rake.rb:2068:in
`standard_exception_handling''
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run''
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load''
/usr/bin/rake:19
It turns out that it''s failing when it tries to do validate_unique on a
text field. When I look into the rails code that''s throwing the error
it''s coming up because it can''t find Encoding::UTF_8. What''s more, if I
skip db:seed and just start up the webserver I get a different error but
it comes down to the exact same cause (can&...