diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-04-29 20:19:58 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-04-29 20:19:58 +0100 |
commit | 18b3ee8d83d7bab1c5735d0743b15e208a19fdf2 (patch) | |
tree | 2216bbf5c85a19e19c7819235d3f784dcb01c5cb | |
parent | cf2187621231d80083da7fff09279b063e74b816 (diff) |
Use an each block
It's idiomatic, and you can assign the elements of the list inline.
-rw-r--r-- | lib/acts_as_xapian/acts_as_xapian.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/acts_as_xapian/acts_as_xapian.rb b/lib/acts_as_xapian/acts_as_xapian.rb index e6fdd4d00..0c89161d7 100644 --- a/lib/acts_as_xapian/acts_as_xapian.rb +++ b/lib/acts_as_xapian/acts_as_xapian.rb @@ -183,10 +183,7 @@ module ActsAsXapian @@values_by_prefix = {} @@value_ranges_store = [] - for init_value_pair in @@init_values - classname = init_value_pair[0] - options = init_value_pair[1] - + @@init_values.each do |classname, options| # go through the various field types, and tell query parser about them, # and error check them - i.e. check for consistency between models @@query_parser.add_boolean_prefix("model", "M") |