Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange missing 'dir?' method
    primarykey
    data
    text
    <p>I've recently started seeing an odd error in my Cucumber tests. Unfortunately I can't trace back to when it was introduced.</p> <p>There are a number of errors in different places along the lines of</p> <pre><code>undefined method `dir?' for #&lt;Order:0x000000098447f8&gt; (NoMethodError) </code></pre> <p>I don't have (and haven't had) a method anywhere in the code called 'dir?'</p> <p>Any ideas what might be calling it and how to fix this one?</p> <p>Update. The code fails with the same message when the page is viewed normally. The code is:</p> <pre><code>def index search = {"meta_sort" =&gt; "id.desc"}.merge(params[:search] || {}) @search = @company.orders.search(search) @orders = @search.paginate(:page =&gt; params[:page], :per_page =&gt; 20).includes(:premise).includes(:address) end </code></pre> <p>Some almost identical code elsewhere works fine.</p> <pre><code>def index @search = @company.users.shoppers.search(params[:search]) @customers = @search.paginate :page =&gt; params[:page], :per_page =&gt; 20 end </code></pre> <p>I tried changing the non-working code to mimic the working code but that didn't make any difference. The search method is provided by the metasearch gem which we've been using happily for a while now.</p> <p>Update 2:</p> <p>It would seem that the fault appeared with the introduction of the <a href="https://github.com/collectiveidea/delayed_job_active_record" rel="nofollow">delayed_job</a> and <a href="https://github.com/lostboy/workless" rel="nofollow">workless</a> gems. Workless is dependent on <a href="https://github.com/adamwiggins/rush" rel="nofollow">Rush</a>, which has a 'dir?' method. I still have no idea why the fault is cropping where it is though.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload