lib/settings.rb in settings-goo-0.3.1 vs lib/settings.rb in settings-goo-0.3.2
- old
+ new
@@ -41,15 +41,10 @@
self.find(:all, :select => 'key', :order => 'key ASC').map{|setting| setting.key.to_sym}
}
end
def self.remove(key)
- setting = Settings.find_by_key(key.to_s)
- if setting
- setting.destroy
- else
- nil
- end
+ Settings.destroy_all(:key => key.to_s).first
end
private
def self.find_key(key)
key = key.to_s
Settings.find_by_key(key) || Settings.new(:key => key)