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.

-Adam

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: https://gist.github.com/744165.

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

Thanks,
Owen



--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
http://www.meetup.com/ruby-112/
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: http://www.meetup.com/ruby-112/members/12466466/
To unsubscribe or to update your mailing list settings, click here: http://www.meetup.com/ruby-112/settings/
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]


Our Sponsors

  • Brewhouse

    Vancouver's leading Rails development agency

  • Shopify

    Everything you need to sell.

  • Clio

    A suite of web-based tools to help manage your law firm

  • CodeCore

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

  • SocialChorus

    Keeping employees connected with their brand & their networks

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