addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwchatcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrosseditemptyheartexportfacebookfolderfullheartglobegmailgoogleimagesinstagramlinklocation-pinmagnifying-glassmailminusmoremuplabelShape 3 + Rectangle 1outlookpersonplusprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Re: [ruby-112] questions about tableless column

From: Adam p.
Sent on: Thursday, December 16, 2010 3:11 PM
Will validates_acceptance_of work?

From the docs, it appears that that will work fine for a virtual attribute.


On Thu, Dec 16, 2010 at 2:58 PM, Owen Ou <[address removed]> wrote:
Hi all,

I have a question about ActiveRecord hope any of you can help me a bit. Thanks in advance :).

I have a ActiveRecord model which has a boolean field to indicate whether the use has accepted the license. I don't want to create a database column related to that but I would like it to consume all the validation stuff provided by ActiveRecord. There are lots of solutions on the web but all of them are focusing on tableless model, while my model also have other fields corresponding to table columns. Here is what I come up with:

This solution seems pretty verbose and I am wondering whether there are better ones out there.


Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Owen Ou ([address removed]) from Vancouver Ruby / Rails Meetup Group.
To learn more about Owen Ou, visit his/her member profile:
To unsubscribe or to update your mailing list settings, click here:
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

Our Sponsors

  • Brewhouse

    Vancouver's leading product development studio

  • CodeCore

    Build Rails Apps in 9 Weeks! Full-Time and Part-Time Development Program

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy