Validate minimum and maximum lenght for separate cases in one time
I validate a surname field like this

      validates :surname,
        :presence       => true,
        :length         => { :within => min_surname_lenght..max_surname_lenght, :message => "is bad (minimum is #{min_surname_lenght}, maximum is  is #{max_surname_lenght})" }

but I wuold like to separate cases when minumum and maximum without separate syntax validation like this

    validates_length_of :name, :minimum => 3
    validates_length_of :name, :maximum => 30

In few words, I wuold like to do something like this (I know, it is wrong):

      validates :surname,
        :presence       => true,
        :length         => { :within => min_surname_lenght..max_surname_lenght, 
                             :message => "is bad (minimum is #{min_surname_lenght}" IF MINIMUM, 
                             :message => "is bad (maximum is  is #{max_surname_lenght})" IF MAXIMUM }

**How it is possible to do that in one time?**
Validate minimum and maximum lenght for separate cases in one time
===

I validate a surname field like this

      validates :surname,
        :presence       => true,
        :length         => { :within => min_surname_lenght..max_surname_lenght, :message => "is bad (minimum is #{min_surname_lenght}, maximum is  is #{max_surname_lenght})" }

but I wuold like to separate cases when minumum and maximum without separate syntax validation like this

    validates_length_of :name, :minimum => 3
    validates_length_of :name, :maximum => 30

In few words, I wuold like to do something like this (I know, it is wrong):

      validates :surname,
        :presence       => true,
        :length         => { :within => min_surname_lenght..max_surname_lenght, 
                             :message => "is bad (minimum is #{min_surname_lenght}" IF MINIMUM, 
                             :message => "is bad (maximum is  is #{max_surname_lenght})" IF MAXIMUM }

**How it is possible to do that in one time?**