aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJames McKinney <james@slashpoundbang.com>2015-05-21 14:15:30 +0200
committerJames McKinney <james@slashpoundbang.com>2015-05-21 14:15:30 +0200
commitef97ebe2b9b12f5c44a9382b7a81cfca765c1696 (patch)
tree8d3541c04d8ee48333ab401bb7fc8d5e9adbd0b2 /lib
parentfa1e0757634656414a8fb62d8bcf1ec0717537df (diff)
Avoid unnecessary ternary operations
Diffstat (limited to 'lib')
-rw-r--r--lib/acts_as_xapian/acts_as_xapian.rb2
-rw-r--r--lib/acts_as_xapian/tasks/xapian.rake2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb
index 7076fc586..784d7ae87 100644
--- a/lib/acts_as_xapian/acts_as_xapian.rb
+++ b/lib/acts_as_xapian/acts_as_xapian.rb
@@ -844,7 +844,7 @@ module ActsAsXapian
raise "Only Time or Date types supported by acts_as_xapian for :date fields, got " + value.class.to_s
end
elsif type == :boolean
- value ? true : false
+ !!value
else
# Arrays are for terms which require multiple of them, e.g. tags
if value.kind_of?(Array)
diff --git a/lib/acts_as_xapian/tasks/xapian.rake b/lib/acts_as_xapian/tasks/xapian.rake
index c1986ce1e..52d94011a 100644
--- a/lib/acts_as_xapian/tasks/xapian.rake
+++ b/lib/acts_as_xapian/tasks/xapian.rake
@@ -9,7 +9,7 @@ namespace :xapian do
# "verbose=true" to print model name as it is run.
desc 'Updates Xapian search index with changes to models since last call'
task :update_index => :environment do
- ActsAsXapian.update_index(ENV['flush'] ? true : false, ENV['verbose'] ? true : false)
+ ActsAsXapian.update_index(ENV['flush'], ENV['verbose'])
end
# Parameters - specify 'models="PublicBody User"' to say which models