Skip to content
Browse files

Fix it?

  • Loading branch information...
1 parent 653355b commit 75e6e5b6cfefc0ab92eaa7547b7f0fbcc7048976 @radar radar committed Feb 25, 2009
Showing with 1 addition and 3 deletions.
  1. +1 −3 leaves/logga/controller.rb
View
4 leaves/logga/controller.rb
@@ -128,15 +128,14 @@ def find_constant(stem, sender, reply_to, name, entry=nil, opts={})
puts name.inspect
puts Constant.find_by_name("Array").inspect
constants = Constant.find_all_by_name(name)
- puts constants.inspect
# Find by name beginning with <blah>.
constants = Constant.all(:conditions => ["name LIKE ?", name + "%"]) if constants.empty?
# Find by fuzzy.
constants = Constant.find_by_sql("select * from constants where name LIKE '%#{for_sql(name.split("").join("%"))}%'") if constants.empty?
if constants.size > 1
# Narrow it down to the constants that only contain the entry we are looking for.
if !entry.nil?
- constants = constants.select { |constant| !constant.entries.find_by_name(entry).nil? }
+ constants = constants.select { |constant| puts constant.entries.inspect; !constant.entries.find_by_name(entry).nil? }
return [constants, constants.size]
else
display_constants(stem, sender, reply_to, constants, opts={})
@@ -177,7 +176,6 @@ def find_method(stem, sender, reply_to, name, constant=nil, opts={})
methods = Entry.find_by_sql("select * from entries where name LIKE '%#{for_sql(name.split("").join("%"))}%'") if methods.empty?
if constant
- puts "CONSTANT SPECIFI"
methods = methods.select { |m| constants.include?(m.constant) }
end
count = 0

0 comments on commit 75e6e5b

Please sign in to comment.
Something went wrong with that request. Please try again.