search for: create_or_update_asset

Displaying 1 result from an estimated 1 matches for "create_or_update_asset".

2009 Aug 07
2
paperclip model fails while when updating with no attachment
...Validation failed: Attachment file name can''t be blank, Attachment file size can''t be blank" There are validation errors from the Assets Model for the presence of :attachment_file_name and :attachment_file_size. I have the below code in my item model: [code] after_save create_or_update_assets! def create_or_update_assets! # return if there are no asset_attributes return true if asset_attributes.nil? || asset_attributes.empty? # pull the attributes from the instance variable asset_attributes.each do |attributes_hash| attributes_hash.symbolize_keys! # if...