search for: asset_attributes

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

2009 Aug 07
2
paperclip model fails while when updating with no attachment
...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 atts_hash has an id (asset already exists). If there''s no id then this...