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

around_validation error for Rails4.1.0beta #251

Open
the-teacher opened this issue May 24, 2013 · 93 comments
Open

around_validation error for Rails4.1.0beta #251

the-teacher opened this issue May 24, 2013 · 93 comments

Comments

@the-teacher
Copy link

Hello!

I have following problem:

Page.last.to_draft
  Page Load (0.2ms)  SELECT "pages".* FROM "pages" ORDER BY "pages"."id" DESC LIMIT 1
   (0.1ms)  begin transaction
   (0.1ms)  rollback transaction
NoMethodError: protected method `around_validation' called for #<StateMachine::Machine:0x00000004382b98>
bin/rails --version
Rails 4.1.0.beta

Maybe it's will be interesting for somebody.

Thank you!

@awsmsrc
Copy link

awsmsrc commented Jul 29, 2013

I have this too! Its being caused on a machinist .make! call.
Happy to help with more info!

@awsmsrc
Copy link

awsmsrc commented Aug 16, 2013

any update on this?

@awsmsrc
Copy link

awsmsrc commented Aug 16, 2013

this is a quick fix, I haven't looked into this more deeply to check for more serious repercussions. With a bit if guidance form a maintainer i'm happy to work on this

@pechorin
Copy link

pechorin commented Sep 2, 2013

bump, same problem on rails (4.1.0.beta)

@nesrual
Copy link

nesrual commented Sep 11, 2013

bump - same problem here using Rails 4.1.0.beta

NoMethodError:
  protected method `around_validation' called for #<StateMachine::Machine:0x007fb0c31c5608>

@wkrsz
Copy link

wkrsz commented Dec 14, 2013

PR from @lukeroberts1990 fixes the problem for me (Rails HEAD)

@the-teacher
Copy link
Author

Wow wow wow! It's steel doesn't work ((
I can't migrate to rails 4.1.0.beta1

@the-teacher
Copy link
Author

config/initializers/state_machine_patch.rb

module StateMachine
  module Integrations
     module ActiveModel
        public :around_validation
     end
  end
end

@sid137
Copy link

sid137 commented Jan 9, 2014

@the-teacher Thanks! works great

@jurikern
Copy link

It's not worked for me, because same error for :around_save protected method (rails 4.1.0.beta1).
Issue (config/initializers/state_machine_patch.rb):

module StateMachine
  module Integrations
     module ActiveModel
        public :around_validation
     end

     module ActiveRecord
        public :around_save
     end
  end
end

@sid137
Copy link

sid137 commented Jan 12, 2014

@Kerny I am on rails edge, and that seems to work

@jurikern
Copy link

Seems like a after_transition not works for rails edge (ActiveRecord) to ...

@amacneil
Copy link

amacneil commented Feb 9, 2014

+1

2 similar comments
@schaary
Copy link

schaary commented Feb 10, 2014

+1

@miry
Copy link

miry commented Feb 19, 2014

+1

@jurikern
Copy link

Last time authored 10 months ago and 19 unresolved pull requests. Very sadly ...

@edbo
Copy link

edbo commented Mar 26, 2014

@obrie Would be a shame to see state machine go stale, I'm a big fan. Rails is now at v4.1.0rc2 which I reckon means we're pretty close to the release which will make this officially 'broken' soon.

I'm sure some people in the community would be happy to help with maintenance.

@richpeck
Copy link

Same problem in 4.1.0 stable

@patrickespake
Copy link

+1
Same problem in 4.1.0 stable.

@cryo28
Copy link

cryo28 commented Apr 11, 2014

+1

2 similar comments
@MirkoMignini
Copy link

+1

@saboyutaka
Copy link

+1

@klaut
Copy link

klaut commented Apr 14, 2014

+1

2 similar comments
@nhoffmann
Copy link

+1

@simonmd
Copy link

simonmd commented Apr 16, 2014

+1

@simonmorley
Copy link

👍

@awsmsrc
Copy link

awsmsrc commented Apr 17, 2014

guys just use AASM (Acts As State Machine), its a shame to see this one go but its had no activity for a while

@catmando
Copy link

word to the wise, while its great that somebody is supporting state_machine, it is not 100% the same behavior as the old state_machine gem... I suspect there were bugs in the old version that have been fixed. At any rate, you might find during the upgrade the quickest fix is the monkey patch.

@akonan
Copy link

akonan commented Nov 4, 2015

+1

2 similar comments
@sennor
Copy link

sennor commented Apr 27, 2016

+1

@rvsingh
Copy link

rvsingh commented Jun 4, 2016

+1

@droupou
Copy link

droupou commented May 3, 2017

Thanks @the-teacher, and @gingermusketeer!

chrisroos added a commit to alphagov/manuals-publisher that referenced this issue May 16, 2017
Patch suggested in pluginaweek/state_machine#251.

TODO: Consider investigating an alternative state machine, e.g. aasm or https://github.com/state-machines/state_machines
chrisroos added a commit to alphagov/manuals-publisher that referenced this issue May 16, 2017
Patch suggested in pluginaweek/state_machine#251.

TODO: Consider investigating an alternative state machine, e.g. aasm or https://github.com/state-machines/state_machines
chrisroos added a commit to alphagov/manuals-publisher that referenced this issue May 16, 2017
Patch suggested in pluginaweek/state_machine#251.

TODO: Consider investigating an alternative state machine, e.g. aasm or https://github.com/state-machines/state_machines
chrisroos added a commit to alphagov/manuals-publisher that referenced this issue May 16, 2017
This fixes the following errors we're seeing:

> NoMethodError: protected method `around_validation' called for
> #<StateMachine::Machine:0x00000004382b98>

The patch was suggested in
pluginaweek/state_machine#251.

It would appear that this StateMachine Gem is no longer maintained so we
might want to consider upgrading to an alternative in future.
chrisroos added a commit to alphagov/manuals-publisher that referenced this issue May 16, 2017
This fixes the following errors we're seeing:

> NoMethodError: protected method `around_validation' called for
> #<StateMachine::Machine:0x00000004382b98>

The patch was suggested in
pluginaweek/state_machine#251.

It would appear that this StateMachine Gem is no longer maintained so we
might want to consider upgrading to an alternative in future.
@ghost ghost deleted a comment Jul 16, 2019
@ghost ghost deleted a comment Jul 16, 2019
luisramos0 added a commit to luisramos0/openfoodnetwork that referenced this issue Jun 15, 2020
luisramos0 added a commit to luisramos0/openfoodnetwork that referenced this issue Jun 17, 2020
luisramos0 added a commit to openfoodfoundation/openfoodnetwork that referenced this issue Jul 7, 2020
luisramos0 added a commit to openfoodfoundation/openfoodnetwork that referenced this issue Oct 13, 2020
luisramos0 added a commit to openfoodfoundation/openfoodnetwork that referenced this issue Oct 13, 2020
luisramos0 added a commit to openfoodfoundation/openfoodnetwork that referenced this issue Oct 15, 2020
luisramos0 added a commit to luisramos0/openfoodnetwork that referenced this issue Nov 3, 2020
luisramos0 added a commit to openfoodfoundation/openfoodnetwork that referenced this issue Nov 4, 2020
Matt-Yorkley pushed a commit to Matt-Yorkley/openfoodnetwork that referenced this issue Nov 5, 2020
luisramos0 added a commit to openfoodfoundation/openfoodnetwork that referenced this issue Nov 6, 2020
Matt-Yorkley pushed a commit to Matt-Yorkley/openfoodnetwork that referenced this issue Nov 6, 2020
Matt-Yorkley pushed a commit to Matt-Yorkley/openfoodnetwork that referenced this issue Nov 7, 2020
Matt-Yorkley pushed a commit to openfoodfoundation/openfoodnetwork that referenced this issue Nov 9, 2020
luisramos0 added a commit to openfoodfoundation/openfoodnetwork that referenced this issue Nov 19, 2020
Matt-Yorkley pushed a commit to Matt-Yorkley/openfoodnetwork that referenced this issue Nov 27, 2020
Matt-Yorkley pushed a commit to openfoodfoundation/openfoodnetwork that referenced this issue Nov 27, 2020
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

No branches or pull requests