aq1018-searchlogic 2.4.16 → 2.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/VERSION.yml +1 -1
- data/lib/searchlogic/active_record/association_proxy_overrides.rb +9 -42
- metadata +3 -4
- data/searchlogic.gemspec +0 -89
    
        data/.gitignore
    CHANGED
    
    
    
        data/VERSION.yml
    CHANGED
    
    
| @@ -3,49 +3,16 @@ module Searchlogic | |
| 3 3 | 
             
                module AssociationProxyOverrides
         | 
| 4 4 | 
             
                  def self.included(klass)
         | 
| 5 5 | 
             
                    klass.class_eval do
         | 
| 6 | 
            -
                       | 
| 7 | 
            -
                       | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
                      create_condition(details[:column], details[:condition], args)
         | 
| 15 | 
            -
                      send_without_preload_searchlogic_conditions(name, *args)
         | 
| 16 | 
            -
                    elsif boolean_condition?(name)
         | 
| 17 | 
            -
                      column = name.to_s.gsub(/^not_/, "")
         | 
| 18 | 
            -
                      named_scope name, :conditions => {column => (name.to_s =~ /^not_/).nil?}
         | 
| 19 | 
            -
                      send_without_preload_searchlogic_conditions(name)
         | 
| 20 | 
            -
                    else
         | 
| 21 | 
            -
                      send_without_preload_searchlogic_conditions(name, *args, &block)
         | 
| 22 | 
            -
                    end
         | 
| 23 | 
            -
                  end
         | 
| 24 | 
            -
                  
         | 
| 25 | 
            -
                  def send_with_preload_searchlogic_ordering(name, *args, &block)
         | 
| 26 | 
            -
                    if name == :order
         | 
| 27 | 
            -
                      named_scope name, lambda { |scope_name|
         | 
| 28 | 
            -
                        return {} if !condition?(scope_name)
         | 
| 29 | 
            -
                        send_without_preload_searchlogic_ordering(scope_name).proxy_options
         | 
| 30 | 
            -
                      }
         | 
| 31 | 
            -
                      send_without_preload_searchlogic_ordering(name, *args)
         | 
| 32 | 
            -
                    elsif details = ordering_condition_details(name)
         | 
| 33 | 
            -
                      create_ordering_conditions(details[:column])
         | 
| 34 | 
            -
                      send_without_preload_searchlogic_ordering(name, *args)
         | 
| 35 | 
            -
                    else
         | 
| 36 | 
            -
                      send_without_preload_searchlogic_ordering(name, *args, &block)
         | 
| 37 | 
            -
                    end
         | 
| 38 | 
            -
                  end
         | 
| 39 | 
            -
                  
         | 
| 40 | 
            -
                  def send_with_preload_searchlogic_or_conditions(name, *args, &block)
         | 
| 41 | 
            -
                    if conditions = or_conditions(name)
         | 
| 42 | 
            -
                      create_or_condition(conditions, args)
         | 
| 43 | 
            -
                      proxy_reflection.klass.class_eval do
         | 
| 44 | 
            -
                        (class << self; self; end).class_eval { alias_method name, conditions.join("_or_") } if !respond_to?(name)
         | 
| 6 | 
            +
                      
         | 
| 7 | 
            +
                      def send(method, *args)
         | 
| 8 | 
            +
                        begin
         | 
| 9 | 
            +
                          super
         | 
| 10 | 
            +
                        rescue NoMethodError => e  
         | 
| 11 | 
            +
                          load_target
         | 
| 12 | 
            +
                          @target.send(method, *args)
         | 
| 13 | 
            +
                        end
         | 
| 45 14 | 
             
                      end
         | 
| 46 | 
            -
                       | 
| 47 | 
            -
                    else
         | 
| 48 | 
            -
                      send_without_preload_searchlogic_or_conditions(name, *args, &block)
         | 
| 15 | 
            +
                      
         | 
| 49 16 | 
             
                    end
         | 
| 50 17 | 
             
                  end
         | 
| 51 18 | 
             
                end
         | 
    
        metadata
    CHANGED
    
    | @@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version | |
| 5 5 | 
             
              segments: 
         | 
| 6 6 | 
             
              - 2
         | 
| 7 7 | 
             
              - 4
         | 
| 8 | 
            -
              -  | 
| 9 | 
            -
              version: 2.4. | 
| 8 | 
            +
              - 17
         | 
| 9 | 
            +
              version: 2.4.17
         | 
| 10 10 | 
             
            platform: ruby
         | 
| 11 11 | 
             
            authors: 
         | 
| 12 12 | 
             
            - Ben Johnson of Binary Logic
         | 
| @@ -14,7 +14,7 @@ autorequire: | |
| 14 14 | 
             
            bindir: bin
         | 
| 15 15 | 
             
            cert_chain: []
         | 
| 16 16 |  | 
| 17 | 
            -
            date: 2010-04- | 
| 17 | 
            +
            date: 2010-04-13 00:00:00 +08:00
         | 
| 18 18 | 
             
            default_executable: 
         | 
| 19 19 | 
             
            dependencies: 
         | 
| 20 20 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -62,7 +62,6 @@ files: | |
| 62 62 | 
             
            - lib/searchlogic/rails_helpers.rb
         | 
| 63 63 | 
             
            - lib/searchlogic/search.rb
         | 
| 64 64 | 
             
            - rails/init.rb
         | 
| 65 | 
            -
            - searchlogic.gemspec
         | 
| 66 65 | 
             
            - spec/active_record/association_proxy_override_spec.rb
         | 
| 67 66 | 
             
            - spec/active_record/consistency_spec.rb
         | 
| 68 67 | 
             
            - spec/core_ext/object_spec.rb
         | 
    
        data/searchlogic.gemspec
    DELETED
    
    | @@ -1,89 +0,0 @@ | |
| 1 | 
            -
            # Generated by jeweler
         | 
| 2 | 
            -
            # DO NOT EDIT THIS FILE DIRECTLY
         | 
| 3 | 
            -
            # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
         | 
| 4 | 
            -
            # -*- encoding: utf-8 -*-
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            Gem::Specification.new do |s|
         | 
| 7 | 
            -
              s.name = %q{searchlogic}
         | 
| 8 | 
            -
              s.version = "2.4.15"
         | 
| 9 | 
            -
             | 
| 10 | 
            -
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 | 
            -
              s.authors = ["Ben Johnson of Binary Logic"]
         | 
| 12 | 
            -
              s.date = %q{2010-04-08}
         | 
| 13 | 
            -
              s.description = %q{Searchlogic makes using ActiveRecord named scopes easier and less repetitive.}
         | 
| 14 | 
            -
              s.email = %q{bjohnson@binarylogic.com}
         | 
| 15 | 
            -
              s.extra_rdoc_files = [
         | 
| 16 | 
            -
                "LICENSE",
         | 
| 17 | 
            -
                 "README.rdoc"
         | 
| 18 | 
            -
              ]
         | 
| 19 | 
            -
              s.files = [
         | 
| 20 | 
            -
                ".gitignore",
         | 
| 21 | 
            -
                 "LICENSE",
         | 
| 22 | 
            -
                 "README.rdoc",
         | 
| 23 | 
            -
                 "Rakefile",
         | 
| 24 | 
            -
                 "VERSION.yml",
         | 
| 25 | 
            -
                 "init.rb",
         | 
| 26 | 
            -
                 "lib/searchlogic.rb",
         | 
| 27 | 
            -
                 "lib/searchlogic/active_record/association_proxy_overrides.rb",
         | 
| 28 | 
            -
                 "lib/searchlogic/active_record/consistency.rb",
         | 
| 29 | 
            -
                 "lib/searchlogic/active_record/named_scope_tools.rb",
         | 
| 30 | 
            -
                 "lib/searchlogic/core_ext/object.rb",
         | 
| 31 | 
            -
                 "lib/searchlogic/core_ext/proc.rb",
         | 
| 32 | 
            -
                 "lib/searchlogic/named_scopes/alias_scope.rb",
         | 
| 33 | 
            -
                 "lib/searchlogic/named_scopes/association_conditions.rb",
         | 
| 34 | 
            -
                 "lib/searchlogic/named_scopes/association_ordering.rb",
         | 
| 35 | 
            -
                 "lib/searchlogic/named_scopes/conditions.rb",
         | 
| 36 | 
            -
                 "lib/searchlogic/named_scopes/or_conditions.rb",
         | 
| 37 | 
            -
                 "lib/searchlogic/named_scopes/ordering.rb",
         | 
| 38 | 
            -
                 "lib/searchlogic/rails_helpers.rb",
         | 
| 39 | 
            -
                 "lib/searchlogic/search.rb",
         | 
| 40 | 
            -
                 "rails/init.rb",
         | 
| 41 | 
            -
                 "searchlogic.gemspec",
         | 
| 42 | 
            -
                 "spec/active_record/association_proxy_override_spec.rb",
         | 
| 43 | 
            -
                 "spec/active_record/consistency_spec.rb",
         | 
| 44 | 
            -
                 "spec/core_ext/object_spec.rb",
         | 
| 45 | 
            -
                 "spec/core_ext/proc_spec.rb",
         | 
| 46 | 
            -
                 "spec/named_scopes/alias_scope_spec.rb",
         | 
| 47 | 
            -
                 "spec/named_scopes/association_conditions_spec.rb",
         | 
| 48 | 
            -
                 "spec/named_scopes/association_ordering_spec.rb",
         | 
| 49 | 
            -
                 "spec/named_scopes/conditions_spec.rb",
         | 
| 50 | 
            -
                 "spec/named_scopes/or_conditions_spec.rb",
         | 
| 51 | 
            -
                 "spec/named_scopes/ordering_spec.rb",
         | 
| 52 | 
            -
                 "spec/search_spec.rb",
         | 
| 53 | 
            -
                 "spec/spec_helper.rb"
         | 
| 54 | 
            -
              ]
         | 
| 55 | 
            -
              s.homepage = %q{http://github.com/binarylogic/searchlogic}
         | 
| 56 | 
            -
              s.rdoc_options = ["--charset=UTF-8"]
         | 
| 57 | 
            -
              s.require_paths = ["lib"]
         | 
| 58 | 
            -
              s.rubyforge_project = %q{searchlogic}
         | 
| 59 | 
            -
              s.rubygems_version = %q{1.3.6}
         | 
| 60 | 
            -
              s.summary = %q{Searchlogic makes using ActiveRecord named scopes easier and less repetitive.}
         | 
| 61 | 
            -
              s.test_files = [
         | 
| 62 | 
            -
                "spec/active_record/association_proxy_override_spec.rb",
         | 
| 63 | 
            -
                 "spec/active_record/consistency_spec.rb",
         | 
| 64 | 
            -
                 "spec/core_ext/object_spec.rb",
         | 
| 65 | 
            -
                 "spec/core_ext/proc_spec.rb",
         | 
| 66 | 
            -
                 "spec/named_scopes/alias_scope_spec.rb",
         | 
| 67 | 
            -
                 "spec/named_scopes/association_conditions_spec.rb",
         | 
| 68 | 
            -
                 "spec/named_scopes/association_ordering_spec.rb",
         | 
| 69 | 
            -
                 "spec/named_scopes/conditions_spec.rb",
         | 
| 70 | 
            -
                 "spec/named_scopes/or_conditions_spec.rb",
         | 
| 71 | 
            -
                 "spec/named_scopes/ordering_spec.rb",
         | 
| 72 | 
            -
                 "spec/search_spec.rb",
         | 
| 73 | 
            -
                 "spec/spec_helper.rb"
         | 
| 74 | 
            -
              ]
         | 
| 75 | 
            -
             | 
| 76 | 
            -
              if s.respond_to? :specification_version then
         | 
| 77 | 
            -
                current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
         | 
| 78 | 
            -
                s.specification_version = 3
         | 
| 79 | 
            -
             | 
| 80 | 
            -
                if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
         | 
| 81 | 
            -
                  s.add_runtime_dependency(%q<activerecord>, [">= 2.0.0"])
         | 
| 82 | 
            -
                else
         | 
| 83 | 
            -
                  s.add_dependency(%q<activerecord>, [">= 2.0.0"])
         | 
| 84 | 
            -
                end
         | 
| 85 | 
            -
              else
         | 
| 86 | 
            -
                s.add_dependency(%q<activerecord>, [">= 2.0.0"])
         | 
| 87 | 
            -
              end
         | 
| 88 | 
            -
            end
         | 
| 89 | 
            -
             |