search for: save_with_validations

Displaying 10 results from an estimated 10 matches for "save_with_validations".

Did you mean: save_with_validation
2008 May 25
2
record will absolutely not save! so weird, please help.
I have a weird problem going on. All of sudden, records for a certain model will not save with #save Please take a look at this: >> p = Payment.new(:payment_reason_id => 1, :payment_method_id => 1, :date => Date.today, :amount => ''5.00'', :payable => Student.find(608)) => #<Payment id: nil, school_id: nil, payment_reason_id: 1, payment_method_id: 1,
2006 Jun 13
7
model validation across multiple views
I have a rather complex object with a number of attributes. For a variety of reasons, I would like one view to create the object with only a couple of fields completed, then a second and third view to finish all the fields. I would like the model to validate_presence_of all these fields, since eventually I need them all there, and I would like each page to validate its portion of the fields that
2006 Jul 25
1
save trouble with has_many belongs_to relationship
I have a bit of code in a controller that looks like this: @current_festival.monitor_preferences.each do |pref| if pref.user_id == @me.id pref.preference = params[:monitor_pref] #pref.save end end @current_festival.save_with_validation(false) the Festival class has_many :monitor_preferences the MonitorPreference class belongs_to :festival In the configuration above, the
2008 Apr 25
0
Spec migrations?
Dear list, I am in the process of writing on an app with is already running. I need to create a couple of structural database changes for which I use migrations. However I want to be absolutely sure I do not destroy any existing data. So RSpec is the way to go! Or so I thought. 1. dropped the test database. 2. create the database. 3. migrate to the version just before the critical migration
2006 May 11
2
Login Generator and Salter
okay, I''m using login generator. And when I log in alwase get failed. So I looked at my log, I gatherd infomation that says on creation the salted pass was: 2b8b06e5a650a4b97f146e6b5ae7ab82c43707e on login the salted pass is: 2b8b06e5a650a4b97f146e6b5ae7ab82c43707e and in my DB it is: 2054d52ca901ff70b5a334cb3e13d8c67940c3f3 So in my DB it change why? -- Posted via
2006 May 12
1
Some error about adding.
Ok so I''m trying to make a little exchange 3 for 1 of 1 higher rank here is the code in the controller: def exch_link @id = @session[:user].id @type = @params[:type] exch(@id,@type) end def exch(user_id,this_type) @user = User.find(:condtions => "id = " + user_id) @ranks =
2006 Jan 19
2
Easy way to handle form input without a model class?
I have a couple forms that I''d like to be able to validate and automatically populate, but it shouldn''t be based on AR. In fact I often have a bunch of small forms that I can''t really justify writing a whole new model class for anyway. I''d like to validate the form input, and then use rails helpers to automatically populate the form if validations fail.
2006 Jun 15
0
Re: rails question
Hi Shelby, No prob, You are having trouble b/c you don''t call @festival.valid? before this line: if !(@festival.errors.invalid? :name ) # => true if name is invalid I wasn''t clear about it in my post, but ActiveRecord::Errors#invalid? doesn''t actually do validations. It just looks at the associated errors object (which is empty if validation hasn''t
2006 May 23
2
Overriding validation?
Is there a "normal" way to override the behavior of validator methods (like validates_presence_of) for updates vs. creation? For example, in the AWDR example store program, the User class validates the presence of the password and its length - which makes sense when the user entry is created. But what if you wanted to provide an update form that updates just certain items
2005 Dec 26
3
Override Validation?
Hi all, is there a way to override the validation methods so as to avoid the div.fieldWithErrors divs from being created on the redisplayed form? Many thanks in advance, Nicky