#393 ✓resolved
BrianTheCoder

Validation won't work for properties defined by attr_accessor

Reported by BrianTheCoder | June 16th, 2008 @ 05:30 PM

The presence validation(and possibly others) breaks because a method(primitive) is called on the properties and it only exists for datamapper properties and not class properties.

Comments and changes to this ticket

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) June 23rd, 2008 @ 07:18 PM

    I'd like to add a quick note that it would be helpful when defining model properties if you could supply an option like :virtual => true, so that DM knew that the property was not to be persisted, but everything else in dm-core would work normally.

    Sam, what do you think about that?

  • Sam Smoot

    Sam Smoot June 23rd, 2008 @ 07:24 PM

    Sounds good to me.

    And we need to fix dm-validations regardless. It used to work. Just wasn't specced I guess, so it broke without notice.

  • BrianTheCoder

    BrianTheCoder June 24th, 2008 @ 01:18 AM

    why not overwrite all attr_ methods to also call a property declaration? I haven't even looked if this is possible, but that's just what comes to mind for me.

  • Jonathan Stott (namelessjon)

    Jonathan Stott (namelessjon) November 30th, 2008 @ 07:29 AM

    • Tag set to bug, dm-more, validations
    • State changed from “new” to “resolved”
    • Assigned user cleared.

    This appears to be fixed as of 0.9.7

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 »

People watching this ticket

Pages