Skip to content

Comments

Update db_acts_as_versioned.rb#2

Open
yankee78 wants to merge 1 commit intomjsommer:masterfrom
yankee78:patch-2
Open

Update db_acts_as_versioned.rb#2
yankee78 wants to merge 1 commit intomjsommer:masterfrom
yankee78:patch-2

Conversation

@yankee78
Copy link

@yankee78 yankee78 commented Jan 6, 2017

I have the error "can't write unknown attribute type" when i try to do a revert_to, i think this might be the cause. (Rails 5)

@krozett
Copy link

krozett commented Feb 14, 2017

I ran into the same issue. Maybe @mjsommer has abandoned this gem... :(

@mjsommer
Copy link
Owner

@yankee78 and/or @krozett , if one or both of you could contribute steps on how to repeat this, then I can take a look.

Thanks in advance!

@yankee78
Copy link
Author

yankee78 commented Feb 16, 2017

@mjsommer thanks for your answer, the issue occurs when we do a @object.revert_to(version_number) on a versioned object (ruby 2.3.1, Rails 5.0.0.1)

@krozett
Copy link

krozett commented Feb 16, 2017

I can confirm this still happens on Ruby 2.4.0, Rails 5.0.1. In the original repo, you can see there is a check to make sure there is an STI column before trying to use it. That check doesn't exist here.

https://github.com/technoweenie/acts_as_versioned/blob/master/lib/acts_as_versioned.rb#L341

@bprice
Copy link

bprice commented Sep 14, 2017

had the same issue with rails 4.2.7.1 and ruby 2.3.3
To reproduce:

  1. create 3 versions
  2. revert_to version 1 or 2

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.

4 participants