search for: reject_invalid_tags

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

2005 May 23
1
has_and_belongs_to_many dual insert error ?
...title varchar(80) ); create table tags ( id int primary key auto_increment, tag varchar(32) ); Domain objects -------------- class Picture < ActiveRecord::Base has_and_belongs_to_many :tags def update_tags(tags) tags = tags.collect! {|name| name.downcase} reject_invalid_tags(tags) remove_deleted_tags(tags) reject_existing_tags(tags) add_tags_to_picture(tags) end protected def reject_invalid_tags(tags) tags.reject! { |name| name.nil? or name.empty? } end def remove_deleted_tags(tags) self.tags.each {|tag...