textonly_operator = !operator.match(/[<=>]/)
self.columns.select do |col|
case col.type
- when :string, :text
+ when :string
true
+ when :text
+ if operator == 'ilike'
+ false
+ else
+ true
+ end
when :datetime, :integer, :boolean
!textonly_operator
else
unless (owner_uuid == current_user.uuid or
current_user.is_admin or
(current_user.groups_i_can(:manage) & [uuid, owner_uuid]).any?)
- if current_user.groups_i_can(:write).index(uuid)
+ if ((current_user.groups_i_can(:write) + [current_user.uuid]) &
+ [uuid, owner_uuid]).any?
return [owner_uuid, current_user.uuid]
else
return [owner_uuid]
"_____-#{uuid_prefix}-_______________"
end
+ def self.uuid_regex
+ %r/[a-z0-9]{5}-#{uuid_prefix}-[a-z0-9]{15}/
+ end
+
def ensure_valid_uuids
specials = [system_user_uuid]
log = Log.new(event_type: event_type).fill_object(self)
yield log
log.save!
- connection.execute "NOTIFY logs, '#{log.id}'"
log_start_state
end