Permalink
Browse files

Update readme, switched from lighthouse to github

  • Loading branch information...
binarylogic committed Aug 7, 2009
1 parent 093ebbb commit c8547d579312a2b7dbdfeac4ac964c3f7bb11972
View
@@ -6,12 +6,12 @@ Searchlogic provides common named scopes and object based searching for ActiveRe
* <b>Documentation:</b> http://rdoc.info/projects/binarylogic/searchlogic
* <b>Repository:</b> http://github.com/binarylogic/searchlogic/tree/master
-* <b>Bugs / feature suggestions:</b> http://binarylogic.lighthouseapp.com/projects/16601-searchlogic
+* <b>Issues:</b> http://github.com/binarylogic/authlogic/issues
* <b>Google group:</b> http://groups.google.com/group/searchlogic
<b>Before contacting me directly, please read:</b>
-If you find a bug or a problem please post it on lighthouse. If you need help with something, please use google groups. I check both regularly and get emails when anything happens, so that is the best place to get help. This also benefits other people in the future with the same questions / problems. Thank you.
+If you find a bug or a problem please post it in the issues section. If you need help with something, please use google groups. I check both regularly and get emails when anything happens, so that is the best place to get help. This also benefits other people in the future with the same questions / problems. Thank you.
== Install & use
@@ -31,7 +31,7 @@ def method_missing(name, *args, &block)
end
def association_condition_details(name)
- assocs = reflect_on_all_associations.reject { |assoc| assoc.options[:polymorphic] }
+ assocs = reflect_on_all_associations.reject { |assoc| assoc.options[:polymorphic] }.sort { |a, b| b.name.to_s.size <=> a.name.to_s.size }
return nil if assocs.empty?
if name.to_s =~ /^(#{assocs.collect(&:name).join("|")})_(\w+)$/
@@ -21,7 +21,10 @@ module RailsHelpers
# * <tt>:params_scope</tt> - the name of the params key to scope the order condition by, defaults to :search
def order(search, options = {}, html_options = {})
options[:params_scope] ||= :search
- options[:as] ||= options[:by].to_s.humanize
+ if !options[:as]
+ id = options[:by].to_s.downcase == "id"
+ options[:as] = id ? options[:by].to_s.upcase : options[:by].to_s.humanize
+ end
options[:ascend_scope] ||= "ascend_by_#{options[:by]}"
options[:descend_scope] ||= "descend_by_#{options[:by]}"
ascending = search.order.to_s == options[:ascend_scope]
View
@@ -71,6 +71,7 @@ class Company < ActiveRecord::Base
class User < ActiveRecord::Base
belongs_to :company, :counter_cache => true
has_many :orders, :dependent => :destroy
+ has_many :orders_big, :class_name => 'Order', :conditions => 'total > 100'
end
class Order < ActiveRecord::Base

0 comments on commit c8547d5

Please sign in to comment.