app/models/feature.rb in usman-0.2.7 vs app/models/feature.rb in usman-0.2.8
- old
+ new
@@ -44,18 +44,18 @@
scope :published, -> { where(status: PUBLISHED) }
scope :disabled, -> { where(status: DISABLED) }
def self.save_row_data(hsh)
- return if hsh[:name].blank?
+ # Initializing error hash for displaying all errors altogether
+ error_object = Kuppayam::Importer::ErrorHash.new
+ return error_object if hsh[:name].blank?
+
feature = Feature.find_by_name(hsh[:name]) || Feature.new
feature.name = hsh[:name]
feature.status = Feature::UNPUBLISHED
- # Initializing error hash for displaying all errors altogether
- error_object = Kuppayam::Importer::ErrorHash.new
-
if feature.valid?
begin
feature.save!
rescue Exception => e
summary = "uncaught #{e} exception while handling connection: #{e.message}"
\ No newline at end of file