Hi,
I just upgraded to rails 1.1 this morning and i am getting a variety of
errors from tests that were passing effortlessly on the previous edge
release (i froze several weeks ago, so I not sure what version that was).
Has anyone else experienced these types errors with the new rails:
I have several errors that are grouped around create and destroy commands
the errors are similar, first the destroy:
test_destroy_comment(ArticleControllerTest):
ActiveRecord::StatementInvalid: Mysql::Error: #42000You have an error in
your SQL syntax; check the manual that corresponds to your
on for the right syntax to use near ''true = true - 1 WHERE (id =
1)'' at line
1: UPDATE articles SET true = true - 1 WHERE (id = 1)
now the error on create:
test_create_child(CategoryControllerTest):
ActiveRecord::StatementInvalid: Mysql::Error: #42000You have an error in
your SQL syntax; check the manual that corresponds to your MySQL server
versi
on for the right syntax to use near ''true = true + 1 WHERE (id =
1)'' at line
1: UPDATE categories SET true = true + 1 WHERE (id = 1)
It appears that the incrementing "1''s" are being read as
boolean statements
by mysql. All of this mysql is generated by rails so I have no idea where to
even start poking around to figure out why it is blowing up.
I am using MYSQL
version 5.0.11 on Windows XP
I am also getting errors on my references using the new "through"
option in
my models. These through methods are almost verbatim from the ones described
in the rails recipe book so I have no idea what to change. I have a user who
has many roles though memberships in which they belong; for example:
class User < ActiveRecord::Base
has_many :memberships
has_many :roles , :through=> :memberships
.............
class Membership < ActiveRecord::Base
belongs_to :user
has_and_belongs_to_many :roles
............
class Role < ActiveRecord::Base
has_and_belongs_to_many :memberships
.............
test_reference_roles_through_membership(UserTest):
ActiveRecord::ActiveRecordError: Invalid source reflection macro
:has_and_belongs_to_many for has_many roles, :through => memberships
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2.4008/lib/active_record/associations/has_many_through_association.rb:75:in
`construct_conditions
''
Rails 1.1 does not fix the existing "shim" error with mysql
`destroy_without_habtm_shim_for_[xxMODELxx]''
The ticket with patch is here and it has worked well for me for several
months:
http://dev.rubyonrails.org/ticket/3175
I am very happy to see Rails moving on to bigger and better things, as soon
as I figure out how to solve these issues I hope to join the rest of you
guys as well!
Anyone with insights on these issues?
Mark
--
--------------------------------------------------------------------
I am Mark Daggett and I approve this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060323/2f511dd4/attachment.html