Notes posted by gdelfino
RSS feedIf your add_index is being ignored in your migration, see this
My add_index command was producing no change in my MySQL 5.0 database:
add_index :designations, [ :scope_type, :scope_id, :role_id, :user_id ], :unique => true
By just adding an index name, the problem was solved:
add_index :designations, [ :scope_type, :scope_id, :role_id, :user_id ], :unique => true, :name => 'my_index'
This happens when the autogenerated index name gets too long. For more info see:
redirect_to :root
You can redirect to your main page using
redirect_to :root
Make sure to configure to root route first:
Re: POST DATA
The ampersand is more common, but the W3C recommends that all web servers support semicolon separators in the place of ampersand separators:
http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2
Use it to solve FixtureClassNotFound errors.
If you are using a non standard table name by means of set_table_name in your model:
class MyClassName < ActiveRecord::Base set_table_name "mytablename" end
then you will get FixtureClassNotFound errors when you try to use fixtures in you unit tests. To solve this use set_fixture_class inside your test:
require 'test_helper' class MyClassNameTest < ActiveSupport::TestCase set_fixture_class :mytablename => MyClassName end
and rename your fixture file to mytablename.yml
Corrected link to ActiveRecord's "new_record?" method
rafaelrosafu, the correct tink to ActiveRecord’s “new_record?” method is:
"http://apidock.com/rails/ActiveRecord/Base/new_record%3F"