Closed lapluviosilla closed 14 years ago
validatious-on-rails running for me, but overall I would not recommend it for production yet (under heavy development, and acutally not really "released" yet - but got spread it seems), but this don't look like a validatious-on-rails error. As you see the stack trace don't have any validatious-on-rails-related calls. I would be pleased if you could help out debug this issue so we know why it appears...or at least throw together a failin test.
I'll try and figure it out, but I do know that I only get this error if I have validatious-on-rails installed. If I remove validatious-on-rails then it works just fine. You can also see that the error does have something to do with a validation function: "/opt/local/lib/ruby/gems/1.8/gems/formtastic-0.2.5/lib/formtastic.rb:477:in `options_require_validation?'"
Thanks
Yes, but validatious-on-rails is not extending ActiveRecord::Base - validation_reflection does that though. COuld you step through the stuff with debugger? Formtastic line 477 dont' match for me: "def input_simple(type, method, options)" =S
I'm using the latest version of formtastic "0.2.5". I just that if I go back to version "0.3.3" of validatious-on-rails the error goes away and starting from version "0.3.4" to "0.3.5" the error appears. At "0.3.3" the validations work perfectly. Changing formtastic versions doesn't seem to do anything. This is the commit that breaks it http://github.com/grimen/validatious-on-rails/commit/74edea852f6aa2c635b00941e4af5c598daf90c1
.
I'll post a debug report in a bit.
This kind of error sometimes appear with nil-strings. I'll focus on the two high-priority issues until we got more info on this one. This one is not very obvious... xP
Heh heh, well I did dump a motherload. Sry about that. ;o)
Found out what "causes" the problem! I'm not sure exactly at what line it breaks, but it only breaks if I have "validates_presence_of" statements in the model with more than 1 property specified.
Look at the model above. If I change
validates_presence_of :first_name, :last_name
to
validates_presence_of :first_name
validates_presence_of :last_name
it starts working.
So, my guess is that your code is probably expecting a symbol or string and then it gets an array instead. I might be wrong, but that is definitely what is causing it though.
Ah, good find! Need to squash this one, smells like a easy task - and hopefully it is.
Sorry, but I can't reproduce this. I used the sample you posted - but commented out "self.full_name = full_name" because that should not work anyway. Everything validates as expected.
Ok, so I went through my fork of test-app and played around with it until I was able to reproduce the bug. First of all I added validatious-on-rails to the project. validatious-on-rails "0.3.7" doesn't seem to work with Rails 2.3.3 anymore so I updated to 2.3.4.
I then removed the formtastic plugin which was version "0.2.4" and used the "0.2.5" formtastic gem from gemcutter instead. After updating formtastic I can now reproduce the bug again. So, it looks like its a incompatibility between formtastic 0.2.5 and validatious-on-rails.
I already pushed my changes to my fork of test-app.
Oh, and just FYI "self.full_name = full_name" does work. It only works because I don't have a full_name setter defined, but you're right, "write_attribute" probably would be better.
OK, will check it out. It do sound like a Formtastic issue though, as I'm hardly touching the view helpers - just adding a class. =S
If I disable validatious-on-rails the error goes away, so the issue is definitely "triggered" by validatious-on-rails, but it could be a problem on the side of formtastic that just happens to come up when using validatious-on-rails.
Yes, something like that. It'll require the debugger to see what actually is happening, hopefully get time to solve it tomorrow.
Formtastic bug, fixed here (not pulled though):
http://github.com/grimen/formtastic/commit/9330ab99110ae3d159cd425c6f0bd930835126ea
Patch pulled into Formtastic just recently, closing this issue.
I just installed validatious-on-rails for the first time and I got a series of errors that resulted in almost every single page giving an error. Looks like a great gem, I'd love to get it working.
I get a "interning empty string" error when I try to access the new page for my person model:
new.html.haml
person.rb
Full stack trace: