rake task ':import' fails when model groups in default scope #381

wants to merge 1 commit into


None yet

2 participants


No description provided.


Example scope:

class Product...
  default_scope lambda {
    joins(:variants).where('available > 0').group('products.id')

Stack trace:

ActiveSupport::OrderedHash can't be coerced into Float
.../gems/tire-0.4.2/lib/tire/tasks.rb:88:in `/'
.../gems/ruby-1.9.2-p180@jambalaya/gems/tire-0.4.2/lib/tire/tasks.rb:88:in `block (4 levels) in <top (required)>'
.../gems/ruby-1.9.2-p180@jambalaya/gems/tire-0.4.2/lib/tire/index.rb:132:in `import'
.../gems/ruby-1.9.2-p180@jambalaya/gems/tire-0.4.2/lib/tire/tasks.rb:83:in `block (3 levels) in <top (required)>'

Essentially, the import works fine, the failure is in rendering the progress bar.

@karmi karmi added a commit that closed this pull request Jun 18, 2012
@cseeger cseeger Added that MyModel#all is called in Rake import task
Closes #380, closes #381.
@karmi karmi closed this in 703292e Jun 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment