Skip to content
New issue

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

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

Already on GitHub? # to your account

List compatible versions of Rails in readme #110

Closed
Valve opened this issue Dec 6, 2013 · 6 comments
Closed

List compatible versions of Rails in readme #110

Valve opened this issue Dec 6, 2013 · 6 comments

Comments

@Valve
Copy link

Valve commented Dec 6, 2013

I started using your gem, and some time later was taken by surprise when found that it's not compatible with Rails 4.

I suggest you kindly mention what version of Rails your gem supports in your Readme file.

@troessner
Copy link
Owner

You're 100% right.

Done -> dafb642

Fixing rails 4 compatibility is pretty high on my todo list.

@Valve
Copy link
Author

Valve commented Dec 6, 2013

Thanks

@troessner
Copy link
Owner

@Valve I started working on rails 4 compatibility, however I need some clues regarding what is not working as expected (since we already run our test suite on rails 4 as well). Can you show me some code that fails when it shouldn't?

@troessner troessner reopened this Dec 19, 2013
@Valve
Copy link
Author

Valve commented Dec 20, 2013

@troessner, thank you for your effort in making this gem!

My use case is the same as I posted earlier in #108:

Migration:

class CreateOrders < ActiveRecord::Migration
  def change
    create_table :orders do |t|
      t.string :status

      t.timestamps
    end
  end
end

Model:

class Order < ActiveRecord::Base
  include ActiveModel::Transitions

  state_machine attribute_name: :status, initial: :created do
    state :paid
    event :pay do
      transitions :to => :paid, from: [:created]
    end
  end
end

Console:

➜  compact_form  rails c
Loading development environment (Rails 4.0.1)
irb(main):001:0> ord = Order.new
NoMethodError: undefined method `call_action' for nil:NilClass
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/transitions-0.1.11/lib/active_model/transitions.rb:93:in `set_initial_state'
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:375:in `_run__738814089938956184__initialize__callbacks'
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/activesupport-4.0.1/lib/active_support/callbacks.rb:80:in `run_callbacks'
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1/lib/active_record/core.rb:188:in `initialize'
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1/lib/active_record/inheritance.rb:27:in `new'
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1/lib/active_record/inheritance.rb:27:in `new'
    from (irb):1
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/railties-4.0.1/lib/rails/commands/console.rb:90:in `start'
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/railties-4.0.1/lib/rails/commands/console.rb:9:in `start'
    from /Users/valentin/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/railties-4.0.1/lib/rails/commands.rb:62:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'
irb(main):002:0> 

@troessner
Copy link
Owner

Ah yeah, I had missed that. Closing here and continuing in #111

@troessner
Copy link
Owner

@Valve see #111 for an update on this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants