Displaying 5 results from an estimated 5 matches for "greater_than".
2008 May 11
0
validates_numericality_of and greater_than* doesn't appear to be working
I''m using Rails 2.0.2 and I have been trying to take advantage of the
"validates_numericality_of" with the ":greater_than" option with
something like this:
validates_numericality_of :users, :greater_than => 0, :only_integer =>
true, :allow_nil => true, :message => "The number of allowed users
must be a whole number greater than zero."
But this doesn''t seem to be catching values se...
2008 May 17
12
validates_numericality_of with greater_than* less_than* simply don't work
It seems that the validations for:
greater_than
greater_than_or_equal_to
less_than
less_than_or_equal_to
equal_to
odd
even
Simply do not work (Rails 2.0.2). I''ve tried every combination I can
think of and these never seem to fire.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribe...
2009 Jun 24
2
At my wits end ! Controlling passed in negative values from a form
...as error.
I have a before_validation method which assigns 0 to undefined values
like so:
self.xxx = 0 unless self.xxx
(where xxx is name of attribute)
I have tried checking for a minus sign in before_validation & validate
method using xxx.to_s.include?("-"). I have also tried
using :greater_than and :minimum options in the
validates_numericality_of call. I also tried validates_inclusion_of,
giving a range from 0..9999999.99.
Nothing seems to work.
Would appreciate any insight into this ! ? What am I missing ??
Thank you
2013 Sep 07
0
[shoulda-matchers gem] validate_numericality_of_matcher strange behaviour
Hello
I have Vacancy model and vacancy_spec test with validates_numericality_of
:salary, greater_than: 1 in the model and
validate_numericality_of(:salary).is_greater_than(2) in the _spec.
When i run rspec spec command tests pass (in some cases and in other they
don''t)
Why?
vacancy.rb
------------------------
class Vacancy < ActiveRecord::Base
validates_presence_of :name, :salary,...
2008 Mar 08
9
Newbie worries with "Developing Rails Applications on Max OSX Leopard"
Hello There,
As a new comer to RoR, I started to follow the article
http://developer.apple.com/tools/developonrailsleopard.html. In short
you create to entities and one one-to-many relation linking them.
Everything was good until the establishment of the relation. I am
unable to go any further than "Linking Models Together" : I can create
the "vendors" mentionned in the