diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/auth_source_ldap.rb | 2 | ||||
-rw-r--r-- | app/models/import.rb | 2 | ||||
-rw-r--r-- | app/models/mail_handler.rb | 2 | ||||
-rw-r--r-- | app/models/query.rb | 4 | ||||
-rw-r--r-- | app/models/setting.rb | 2 | ||||
-rw-r--r-- | app/models/wiki_page.rb | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb index b9cf21ccc..a2d43b7f7 100644 --- a/app/models/auth_source_ldap.rb +++ b/app/models/auth_source_ldap.rb @@ -245,7 +245,7 @@ class AuthSourceLdap < AuthSource # Singleton class method is public class << self def get_attr(entry, attr_name) - if !attr_name.blank? + if attr_name.present? value = entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name] (+value.to_s).force_encoding('UTF-8') end diff --git a/app/models/import.rb b/app/models/import.rb index 5dcb05882..fe3f24fab 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -94,7 +94,7 @@ class Import < ActiveRecord::Base 'notifications' => '0' ) - if options.key?(:project_id) && !options[:project_id].blank? + if options.key?(:project_id) && options[:project_id].present? # Do not fail if project doesn't exist begin project = Project.find(options[:project_id]) diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 2fa4de00d..5925608bd 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -365,7 +365,7 @@ class MailHandler < ActionMailer::Base end if override && (v = extract_keyword!(cleaned_up_text_body, attr, options[:format])) v - elsif !handler_options[:issue][attr].blank? + elsif handler_options[:issue][attr].present? handler_options[:issue][attr] end end diff --git a/app/models/query.rb b/app/models/query.rb index 4a0aeb4fd..473ea4d86 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -505,7 +505,7 @@ class Query < ActiveRecord::Base add_filter_error(field, :blank) unless # filter requires one or more values - (values_for(field) and !values_for(field).first.blank?) or + (values_for(field) and values_for(field).first.present?) or # filter doesn't require any value ["o", "c", "!*", "*", "nd", "t", "ld", "nw", "w", "lw", "l2w", "nm", "m", "lm", "y", "*o", "!o"].include? operator_for(field) end if filters @@ -830,7 +830,7 @@ class Query < ActiveRecord::Base def column_names=(names) if names - names = names.select {|n| n.is_a?(Symbol) || !n.blank?} + names = names.select {|n| n.is_a?(Symbol) || n.present?} names = names.collect {|n| n.is_a?(Symbol) ? n : n.to_sym} if names.delete(:all_inline) names = available_inline_columns.map(&:name) | names diff --git a/app/models/setting.rb b/app/models/setting.rb index 155ed23b1..81f121db4 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -111,7 +111,7 @@ class Setting < ActiveRecord::Base v = YAML.safe_load(v, permitted_classes: Rails.configuration.active_record.yaml_column_permitted_classes) v = force_utf8_strings(v) end - v = v.to_sym if available_settings[name]['format'] == 'symbol' && !v.blank? + v = v.to_sym if available_settings[name]['format'] == 'symbol' && v.present? v end diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 594c44bd6..0ee06673e 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -273,7 +273,7 @@ class WikiPage < ActiveRecord::Base protected def validate_parent_title - errors.add(:parent_title, :invalid) if !@parent_title.blank? && parent.nil? + errors.add(:parent_title, :invalid) if @parent_title.present? && parent.nil? errors.add(:parent_title, :circular_dependency) if parent && (parent == self || parent.ancestors.include?(self)) if parent_id_changed? && parent && (parent.wiki_id != wiki_id) errors.add(:parent_title, :not_same_project) |