#93 ✓resolved
vincent

Options merging ??

Reported by vincent | April 17th, 2009 @ 02:25 PM

Hi

It should be great to merge the original options with the new ones, preventing from adding all other options when we want to modifiy only one.

Example :

If I want only to add the options :allow_blank for the login field, I have to write :

acts_as_authentic do |c|

c.logged_in_timeout = 10.minutes
c.validates_length_of_login_field_options :within => 6..100, :allow_blank => true
c.validates_format_of_login_field_options :with => /A\w[w\.\-_@ ]+z/, :allow_blank => true, :message => I18n.t('authlogic.error_messages.login_invalid')

end

I need to rewrite the :within option and all options for the format validations...

Or maybe i missed something?

Vincent Paris, France

Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson April 18th, 2009 @ 03:31 AM

    • State changed from “new” to “open”

    Well, I wanted to keep it as plain old ruby. So you can do whatever you want with that. Just delete the keys you don't want to use, etc. It's just ruby.

    I am considering adding additional functions for validation configuration that would merge options. I'll think about it and update this ticket when I decide on something.

  • Ben Johnson

    Ben Johnson April 21st, 2009 @ 12:20 AM

    • State changed from “open” to “resolved”

    All of the validation options now have a convenience method called merge_*

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.

People watching this ticket

Tags

Pages