Closed ricardodovalle closed 10 years ago
I need to dig into this, but I think it's a problem that only happens in development due to Rails' autoloading classes. cf. #16
I will try in production, thank you.
Thanks @joecorcoran, in production it is working very well.
I am using the master version
gem 'judge', git: 'git://github.com/joecorcoran/judge.git'
What version would you recommend to use?
Use the latest version on Rubygems unless you are relying on a bug fix on master, in which case stick with the git option. I should release a new version soon.
@ricardodovalle Did you solve this issue? I mean in development, not in production.
@joecorcoran the new version that you were mentioning in the last post (may 15), was released? and if it was released, it solve the problem in development mode too?
Thanks.
Not sure about production env, but it sure is still broken in develpment mode, I have seen other issue for this closed. I am using 'master' commit e79cda4393358630b917ca94d1a4c24e71ff8832.
I think this is a 'Singleton' usage problem, look here:
def expose(klass, *attributes)
attrs = (@@exposed[klass] ||= [])
attrs.concat(attributes).uniq!
end
This is a workaround that works for me (in development):
before, fragile:
Judge.configure do
expose User, :username
end
after, solid:
Judge.config.exposed[User] = [:username]
Same error here. Tried to change it as @rubyconvict suggested, but the error still occurs in development and production mode.
Edit: actually there was a typo in my params list. Seems to be ok now with @rubyconvict suggestion, but the duplicated field error message doesn't appear anymore.
Glad I could help.
I am trying to use the gem judge and uniqueness validation, but sometimes I am getting a weird error, at most of time, after a validation fail.
After that, the XHR request always return this: ["Judge validation for Person#name not allowed"]
But, if I reload the server and the page, all it will worked fine one or there times, before i change the page or get one uniqueness error (i think)
Thanks,
The code