Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for rails 4.0 #490

Merged
merged 1 commit into from Mar 2, 2013
Merged

support for rails 4.0 #490

merged 1 commit into from Mar 2, 2013

Conversation

hasimo
Copy link

@hasimo hasimo commented Feb 26, 2013

i tested it with rails 3.2.12 and rails 4.0.0beta1.
rake spec was all passed.

@sferik
Copy link
Collaborator

sferik commented Feb 26, 2013

I think the constraint should be ['>= 3', '< 5']. We know that the current delayed_job code works on Rails 3 or Rails 4. I'm not confident that it will work with all future versions of Rails ever released, which is what this constraint specifies.

Please see this blog post by @wycats: Using >= Considered Harmful (or, What’s Wrong With >=)

@agrobbin
Copy link

agrobbin commented Mar 1, 2013

spec/spec_helper.rb:44:

class Story < ActiveRecord::Base
  self.primary_key = 'story_id'
  def tell; text; end
  def whatever(n, _); tell*n; end
  default_scope where(:scoped => true)

  handle_asynchronously :whatever
end

Something else I noticed while testing this with Rails 4 is that the default_scope needs to be set like this:

default_scope { where(:scoped => true) }

@sferik
Copy link
Collaborator

sferik commented Mar 1, 2013

@agrobbin Thanks! I applied this change in b90a3a4.

@sferik
Copy link
Collaborator

sferik commented Mar 2, 2013

I guess I'll merge this the dependency specification myself.

sferik added a commit that referenced this pull request Mar 2, 2013
@sferik sferik merged commit ebf70f0 into collectiveidea:master Mar 2, 2013
clifff pushed a commit to clifff/delayed_job that referenced this pull request Dec 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants