i have a model that has a field 'votes'. users may only vote once per
session and so i am using a session variable to track whether they
have voted. i would like to use rails validation within the model to
output an error if a user tries to vote more than once.
my issue is that this tracking of whether the user has voted this
session is not tracked in the database (it is in the session
variable). is it still possible to use the rails validation framework
to validate? i am doing the appropriate checking in the controller,
i'm just not sure how to then propagate this check to the model (in
order to use the validation framework). can i just define a new
attribute for the model even though it is not a field in the db?