Git Product home page Git Product logo

Comments (10)

mrkamel avatar mrkamel commented on May 23, 2024 2

thanks for checking. v1.2.3 released

from search_cop.

mrkamel avatar mrkamel commented on May 23, 2024

Thanks for the report! Could you also share the respective search scope specification? Thx

from search_cop.

noordean avatar noordean commented on May 23, 2024

Here's it:

    search_scope :search do
      attributes :created_at, :completed, :due_date, :flagged, :category, :body
    end

    search_scope :search_user do
      attributes :created_at, :completed, :due_date, :flagged, :category, :body
      attributes user: 'user.name'
    end

    search_scope :search_assignee do
      attributes :created_at, :completed, :due_date, :flagged, :category, :body
      attributes assignees: ['assignees.name']
    end

    search_scope :search_by_step do
      attributes :current_step_body
    end

Thanks for you quick response by the way.

EDITED:
I will take a look again to see exactly which of the scopes is/are causing the issue, and get back to you, if that would help.

from search_cop.

mrkamel avatar mrkamel commented on May 23, 2024

Reproduction added. Will fix it asap.

from search_cop.

mrkamel avatar mrkamel commented on May 23, 2024

maybe you could quickly validate that

gem "search_cop", git: "https://github.com/mrkamel/search_cop", branch: "fix-model-namespace"

is working for you before i release it

from search_cop.

mrkamel avatar mrkamel commented on May 23, 2024

v1.2.2 released which should fix it. Re-open otherwise.

from search_cop.

noordean avatar noordean commented on May 23, 2024

Sorry for my late response. It's not fixed yet. I get this error now:

rails_1         | uninitialized constant Note
rails_1         | Did you mean?  Notes
rails_1         | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/inflector/methods.rb:274:in `const_get'
rails_1         | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/inflector/methods.rb:274:in `constantize'
rails_1         | /usr/local/bundle/gems/activesupport-6.1.4.7/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar/attributes.rb:81:in `klass_for'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar/attributes.rb:92:in `attribute_for'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar/attributes.rb:62:in `block in attributes'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar/attributes.rb:62:in `collect'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar/attributes.rb:62:in `attributes'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar/attributes.rb:54:in `compatible?'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:90:in `block in evaluate'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:90:in `select'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:90:in `evaluate'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:112:in `evaluate'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:17:in `collect'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:17:in `evaluate'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:119:in `evaluate'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:17:in `collect'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop_grammar.rb:17:in `evaluate'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop/grammar_parser.rb:18:in `parse'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop.rb:28:in `parse'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop/query_builder.rb:9:in `initialize'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop.rb:64:in `new'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop.rb:64:in `unsafe_search_cop'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop.rb:56:in `search_cop'
rails_1         | /usr/local/bundle/bundler/gems/search_cop-55ff5aea76cc/lib/search_cop.rb:47:in `block in search_scope'
rails_1         | /usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/relation/delegation.rb:108:in `public_send'
rails_1         | /usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/relation/delegation.rb:108:in `block in method_missing'
rails_1         | /usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/relation.rb:406:in `block in scoping'
rails_1         | /usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/relation.rb:804:in `_scoping'
rails_1         | /usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/relation.rb:406:in `scoping'
rails_1         | /usr/local/bundle/gems/activerecord-6.1.4.7/lib/active_record/relation/delegation.rb:108:in `method_missing'

from search_cop.

mrkamel avatar mrkamel commented on May 23, 2024

ok, thanks, i was able to reproduce it and pushed a fix. Could you please verify via

gem "search_cop", git: "https://github.com/mrkamel/search_cop", branch: "fix-inherited-and-namespaced-models"

thanks.

from search_cop.

noordean avatar noordean commented on May 23, 2024

Ok, give me a few minutes.

from search_cop.

noordean avatar noordean commented on May 23, 2024

It's fixed now 🎉 . Thanks @mrkamel

from search_cop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.