remove find or create by name
This commit is contained in:
parent
f251500aa4
commit
1bf0e8b94e
@ -2,9 +2,4 @@ class LocalezeCategory < ActiveRecord::Base
|
|||||||
attr_accessible :name
|
attr_accessible :name
|
||||||
has_and_belongs_to_many :list_entries
|
has_and_belongs_to_many :list_entries
|
||||||
|
|
||||||
def self.find_or_create_by_name(name, &block)
|
|
||||||
obj = self.find_or_create_by_name( name ) || self.new(:name => name)
|
|
||||||
yield obj
|
|
||||||
obj.save
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user