search for: after_validation_on_cr

Displaying 6 results from an estimated 6 matches for "after_validation_on_cr".

2007 Dec 27
0
Silent Validation Failures
Hello, I''m having trouble with after_validation_on_create causing my validations to fail silently. I''ve got a restful_authentication based user model that requires a number of things from the user: email, dob, gender, etc. When a user is created, all of these are validated in various ways (presence, inclusion_of, etc.). Afterwards, I call...
2007 Feb 25
0
validates_associated causing weird results
...n twice. The associated model, Upload, which handles uploaded files and saves them, is saving each uploaded file twice in a row. This doesn''t happen if I remove "validates_associated" from the model it belongs to, or if I have the model save files during after_create instead of after_validation_on_create. I have changed it so it works for the time being, but at the moment I''m baffled. Even in the Image model which is a subclass of Upload, thumbnails made with RMagick are saved twice instead of once. I have no idea why. I''ve pastied everything. There''s really noth...
2005 Dec 29
7
belongs_to causing NoMethodError exceptions ... ?
I''ve got a really strange problem using belongs_to. I apologize in advance for the length... this is going to take a while to explain. Basic idea: Creating a User requires that the user enter an email address and activation key that matches an existing PendingUser. After creating the user successfully, that pending user should be marked as "used". The problem: When I
2006 Jul 17
1
How to DRY up validates_presence_of
Given the case of validating the presence of an attribute and then performing other tests on said attribute, how do you go about not having to check for nil in the other tests? Example: validates_presence_of :start_date, :end_date validate :validate_start_date_before_end_date def validate_start_date_before_end_date # without this check an exception will be thrown on access to the
2006 May 24
1
Observer behavior differences between DEV and TEST environments ?
..., I took a step back and put in the following code: class GreenbackTransactionObserver < ActiveRecord::Observer %w( after_find after_initialize before_save after_save before_create after_create before_update after_update before_validation after_validation before_validation_on_create after_validation_on_create before_validation_on_update after_validation_on_update before_destroy after_destroy ).each do |method| define_method(method) do |txn| txn.logger.info "#{method} (observer)" true end end end My model looks like this: class GreenbackTransaction < Activ...
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde