app/models/permission.rb in usman-0.1.5 vs app/models/permission.rb in usman-0.1.6dev2
- old
+ new
@@ -1,11 +1,8 @@
class Permission < Usman::ApplicationRecord
- require 'import_error_handler.rb'
- extend Usman::ImportErrorHandler
-
- # Associations
+ # Associations
belongs_to :user
belongs_to :feature
# Validations
validates :can_create, inclusion: { in: [true, false] }
@@ -28,19 +25,17 @@
LOWER(u.username) LIKE LOWER('%#{query}%') OR\
LOWER(u.email) LIKE LOWER('%#{query}%') OR\
LOWER(f.name) LIKE LOWER('%#{query}%')")}
- def self.save_row_data(row, base_path)
+ def self.save_row_data(row)
- image_base_path = base_path + "images/"
-
row.headers.each{ |cell| row[cell] = row[cell].to_s.strip }
return if row[:user].blank? || row[:feature].blank?
# Initializing error hash for displaying all errors altogether
- error_object = Usman::ErrorHash.new
+ error_object = Kuppayam::Importer::ErrorHash.new
user = User.find_by_username(row[:user])
unless user
summary = "User '#{row[:user]}' doesn't exist"
error_object.errors << { summary: summary }
\ No newline at end of file