If you have: validates_presence_of validates_uniqueness_of ... validates_each What fires in what order? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Mar 9, 2011 at 10:19 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you have: > > validates_presence_of > validates_uniqueness_of > ... > > validates_each > > > What fires in what order? >the way you order them in your model file. so validates_presence_of goes first, uniqueness next then validates_each.> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ok, well the value in the validates_each is giving me nil, not sure why. Error is: The error occurred while evaluating nil.>=): validates_presence_of :code validates_uniqueness_of :code validates_presence_of :valid_from_date, :expiry_date validates_each :expiry_date do |record, attribute, value| record.errors.add(:expiry_date, ''must be after or the same as valid from date'') unless value >= record.valid_from_date end On Tuesday, March 8, 2011 8:28:21 PM UTC-6, jim wrote:> > > > On Wed, Mar 9, 2011 at 10:19 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> If you have: >> >> validates_presence_of >> validates_uniqueness_of >> ... >> >> validates_each >> >> >> What fires in what order? >> > > the way you order them in your model file. so validates_presence_of goes > first, > uniqueness next then validates_each. > > >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Mar 9, 2011 at 10:34 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ok, well the value in the validates_each is giving me nil, not sure why. > Error is: > > The error occurred while evaluating nil.>=): > > validates_presence_of :code > validates_uniqueness_of :code > validates_presence_of :valid_from_date, :expiry_date > validates_each :expiry_date do |record, attribute, value| > record.errors.add(:expiry_date, ''must be after or the same as valid from > date'') unless value >= record.valid_from_date > end > >the error says that value is nil so check first if it''s nil or not. validates_each :expiry_date do |record, attribute, value| record.errors.add(:expiry_date, ''must be after or the same as valid from date'') if value && !(value >= record.valid_from_date) end> On Tuesday, March 8, 2011 8:28:21 PM UTC-6, jim wrote: >> >> >> >> On Wed, Mar 9, 2011 at 10:19 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> If you have: >>> >>> validates_presence_of >>> validates_uniqueness_of >>> ... >>> >>> validates_each >>> >>> >>> What fires in what order? >>> >> >> the way you order them in your model file. so validates_presence_of goes >> first, >> uniqueness next then validates_each. >> >> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Ruby on Rails: Talk" group. >>> To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> >> >> -- >> ------------------------------------------------------------- >> visit my blog at http://jimlabs.heroku.com >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
But is the validates_presence_of supposed to catch that first? On Tuesday, March 8, 2011 9:33:40 PM UTC-6, jim wrote:> > > > On Wed, Mar 9, 2011 at 10:34 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Ok, well the value in the validates_each is giving me nil, not sure why. >> Error is: >> >> The error occurred while evaluating nil.>=): >> >> validates_presence_of :code >> validates_uniqueness_of :code >> validates_presence_of :valid_from_date, :expiry_date >> validates_each :expiry_date do |record, attribute, value| >> record.errors.add(:expiry_date, ''must be after or the same as valid from >> date'') unless value >= record.valid_from_date >> end >> >> > the error says that value is nil so check first if it''s nil or not. > > validates_each :expiry_date do |record, attribute, value| > record.errors.add(:expiry_date, ''must be after or the same as valid from > date'') if value && !(value >= record.valid_from_date) > end > > >> On Tuesday, March 8, 2011 8:28:21 PM UTC-6, jim wrote: >>> >>> >>> >>> On Wed, Mar 9, 2011 at 10:19 AM, Me <cha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> If you have: >>>> >>>> validates_presence_of >>>> validates_uniqueness_of >>>> ... >>>> >>>> validates_each >>>> >>>> >>>> What fires in what order? >>>> >>> >>> the way you order them in your model file. so validates_presence_of goes >>> first, >>> uniqueness next then validates_each. >>> >>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Ruby on Rails: Talk" group. >>>> To post to this group, send email to rubyo...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To unsubscribe from this group, send email to >>>> rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> >>>> For more options, visit this group at >>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>> >>> >>> >>> -- >>> ------------------------------------------------------------- >>> visit my blog at http://jimlabs.heroku.com >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Mar 9, 2011 at 11:36 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> But is the validates_presence_of supposed to catch that first? > >ah ok, now i see what you mean. validations don''t work that way. all validations are run even when the previous validations fail. that''s why you need to add :if and :except arguments so that some validations are run only when some conditions are met.> On Tuesday, March 8, 2011 9:33:40 PM UTC-6, jim wrote: >> >> >> >> On Wed, Mar 9, 2011 at 10:34 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> Ok, well the value in the validates_each is giving me nil, not sure why. >>> Error is: >>> >>> The error occurred while evaluating nil.>=): >>> >>> validates_presence_of :code >>> validates_uniqueness_of :code >>> validates_presence_of :valid_from_date, :expiry_date >>> validates_each :expiry_date do |record, attribute, value| >>> record.errors.add(:expiry_date, ''must be after or the same as valid >>> from date'') unless value >= record.valid_from_date >>> end >>> >>> >> the error says that value is nil so check first if it''s nil or not. >> >> validates_each :expiry_date do |record, attribute, value| >> record.errors.add(:expiry_date, ''must be after or the same as valid from >> date'') if value && !(value >= record.valid_from_date) >> end >> >> >>> On Tuesday, March 8, 2011 8:28:21 PM UTC-6, jim wrote: >>> >>>> >>>> >>>> On Wed, Mar 9, 2011 at 10:19 AM, Me <cha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>>> If you have: >>>>> >>>>> validates_presence_of >>>>> validates_uniqueness_of >>>>> ... >>>>> >>>>> validates_each >>>>> >>>>> >>>>> What fires in what order? >>>>> >>>> >>>> the way you order them in your model file. so validates_presence_of goes >>>> first, >>>> uniqueness next then validates_each. >>>> >>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Ruby on Rails: Talk" group. >>>>> To post to this group, send email to rubyo...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> To unsubscribe from this group, send email to >>>>> rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>>> >>>> >>>> >>>> >>>> -- >>>> ------------------------------------------------------------- >>>> visit my blog at http://jimlabs.heroku.com >>>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Ruby on Rails: Talk" group. >>> To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> >> >> -- >> ------------------------------------------------------------- >> visit my blog at http://jimlabs.heroku.com >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
OK, cool. Thanks. On Tuesday, March 8, 2011 9:40:30 PM UTC-6, jim wrote:> > > > On Wed, Mar 9, 2011 at 11:36 AM, Me <chab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> But is the validates_presence_of supposed to catch that first? >> >> > ah ok, now i see what you mean. > > validations don''t work that way. all validations are run even when the > previous > validations fail. that''s why you need to add :if and :except arguments so > that > some validations are run only when some conditions are met. > > >> On Tuesday, March 8, 2011 9:33:40 PM UTC-6, jim wrote: >>> >>> >>> >>> On Wed, Mar 9, 2011 at 10:34 AM, Me <cha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> Ok, well the value in the validates_each is giving me nil, not sure >>>> why. Error is: >>>> >>>> The error occurred while evaluating nil.>=): >>>> >>>> validates_presence_of :code >>>> validates_uniqueness_of :code >>>> validates_presence_of :valid_from_date, :expiry_date >>>> validates_each :expiry_date do |record, attribute, value| >>>> record.errors.add(:expiry_date, ''must be after or the same as valid >>>> from date'') unless value >= record.valid_from_date >>>> end >>>> >>>> >>> the error says that value is nil so check first if it''s nil or not. >>> >>> validates_each :expiry_date do |record, attribute, value| >>> record.errors.add(:expiry_date, ''must be after or the same as valid >>> from date'') if value && !(value >= record.valid_from_date) >>> end >>> >>> >>>> On Tuesday, March 8, 2011 8:28:21 PM UTC-6, jim wrote: >>>> >>>>> >>>>> >>>>> On Wed, Mar 9, 2011 at 10:19 AM, Me <cha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> >>>>>> If you have: >>>>>> >>>>>> validates_presence_of >>>>>> validates_uniqueness_of >>>>>> ... >>>>>> >>>>>> validates_each >>>>>> >>>>>> >>>>>> What fires in what order? >>>>>> >>>>> >>>>> the way you order them in your model file. so validates_presence_of >>>>> goes first, >>>>> uniqueness next then validates_each. >>>>> >>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Ruby on Rails: Talk" group. >>>>>> To post to this group, send email to ruby...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>> To unsubscribe from this group, send email to >>>>>> rubyo...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>> >>>>>> For more options, visit this group at >>>>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ------------------------------------------------------------- >>>>> visit my blog at http://jimlabs.heroku.com >>>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Ruby on Rails: Talk" group. >>>> To post to this group, send email to rubyo...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To unsubscribe from this group, send email to >>>> rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> For more options, visit this group at >>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>> >>> >>> >>> -- >>> ------------------------------------------------------------- >>> visit my blog at http://jimlabs.heroku.com >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 9 March 2011 02:28, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Wed, Mar 9, 2011 at 10:19 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> If you have: >> >> validates_presence_of >> validates_uniqueness_of >> ... >> >> validates_each >> >> >> What fires in what order? > > the way you order them in your model file. so validates_presence_of goes > first, > uniqueness next then validates_each.Really? I''m not 100% sure that''s right - although happy to be corrected. I''ve not looked at the source, but I was under the impression the validations were added to a hash that was iterated when "valid?" is called, and a hash returns its elements in no guaranteed order... I tend to do stuff like: validates_presence_of :foo validates_uniqueness_of :foo, :if => :foo validates_length_of :foo, :maximum => 255, :if => :foo -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 9 March 2011 03:40, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Wed, Mar 9, 2011 at 11:36 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> But is the validates_presence_of supposed to catch that first? >> > > ah ok, now i see what you mean. > validations don''t work that way. all validations are run even when the > previous > validations fail. that''s why you need to add :if and :except arguments so > that > some validations are run only when some conditions are met.It''s a very annoy feature of websites that tell you one error at a time: "secret phrase cannot be blank" so you enter a phrase... "secret phrase must be longer than 6 characters" so you frown and make it longer "secret phrase can only contain alpha-numeric characters" so you growl and remove the punctuation and tweak the phrase "secret phrase must be no longer than 20 characters" you shop elsewhere.. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Mar 9, 2011 at 4:38 PM, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 9 March 2011 02:28, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On Wed, Mar 9, 2011 at 10:19 AM, Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > >> If you have: > >> > >> validates_presence_of > >> validates_uniqueness_of > >> ... > >> > >> validates_each > >> > >> > >> What fires in what order? > > > > the way you order them in your model file. so validates_presence_of goes > > first, > > uniqueness next then validates_each. > > Really? I''m not 100% sure that''s right - although happy to be corrected. > > I''ve not looked at the source, but I was under the impression the > validations were added to a hash that was iterated when "valid?" is > called, and a hash returns its elements in no guaranteed order... > >i''m not sure with rails 3, but i''m pretty sure with rails 2.x as i remember adding comments in the models reminding coders to refrain from changing the order of validations. since changing the validation orders changes the order of the errors shown in the view. but now that you mention it, maybe the order of when validations are run is different with the order of errors shown.> I tend to do stuff like: > > validates_presence_of :foo > validates_uniqueness_of :foo, :if => :foo > validates_length_of :foo, :maximum => 255, :if => :foo > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 9, 9:04 am, Jim Ruther Nill <jvn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > i''m not sure with rails 3, but i''m pretty sure with rails 2.x as i remember > adding comments in the models reminding coders to refrain from changing > the order of validations. since changing the validation orders changes the > order of the errors shown in the view. > > but now that you mention it, maybe the order of when validations are run > is different with the order of errors shown. >The errors are stored in a hash (or at least used to be) so ordering isn''t guaranteed on ruby 1.8 Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.