undefined method validate_uniqueness_of

213 views
Skip to first unread message

Francois

unread,
Oct 4, 2010, 2:00:15 PM10/4/10
to shoulda
i'm trying to get up-to-speed with shoulda. Its been working well
though when I tried to use

should validate_uniqueness_of :name

I received the following error:

/opt/local/lib/ruby/gems/1.8/gems/shoulda-2.11.3/lib/shoulda/
context.rb:429:in `send': undefined method `validate_uniqueness_of'

Charles Johnson

unread,
Oct 4, 2010, 4:34:07 PM10/4/10
to sho...@googlegroups.com
Are you using the call in a context block by chance? If you are, try taking it out of the context.

~Charles~ 

Francois

unread,
Oct 5, 2010, 1:00:15 AM10/5/10
to shoulda
Hi Charles,
thanks for the response. I had tried it both in and out of a context
block and was receiving the same error in both cases.

However, I just got it working a couple minutes ago. The
test_helper.rb in the project that I'm working on had the following
line near the top:
require 'shoulda/rails'

i commented it out and the undefined method error went away.

- Francois




On Oct 4, 1:34 pm, Charles Johnson <gm.johns...@gmail.com> wrote:

Charles Johnson

unread,
Oct 5, 2010, 3:27:38 PM10/5/10
to sho...@googlegroups.com
Great!

--
Individuals over processes. Interactions over tools.

Agile Rails training from thoughtbot, the makers of Clearance, Shoulda, & Factory Girl:
http://thoughtbot.com/services/training

The Shoulda group:
http://groups.google.com/group/shoulda

To post to this group, send email to
sho...@googlegroups.com

To unsubscribe from this group, send email to
shoulda+u...@googlegroups.com

Reply all
Reply to author
Forward
0 new messages