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

Missing columns in _versions table cause error #1

Open
drothlis opened this issue Apr 29, 2009 · 1 comment
Open

Missing columns in _versions table cause error #1

drothlis opened this issue Apr 29, 2009 · 1 comment

Comments

@drothlis
Copy link

acts_as_versioned should determine which columns to version, based on the #{model}_versions table.

The documentation for ActiveRecord::Acts::Versioned::ClassMethods#acts_as_versioned says:

The _versions table should contain all the fields you want versioned

but this is clearly not the case (with version 0.5.2). For any attributes missing in the _versions table, I get:

undefined method attribute=' for #Model::Version:0x180dfe4 vendor/acts_as_versioned/lib/acts_as_versioned.rb:331:in send'
vendor/acts_as_versioned/lib/acts_as_versioned.rb:331:in clone_versioned_model' vendor/acts_as_versioned/lib/acts_as_versioned.rb:330:in each'
vendor/acts_as_versioned/lib/acts_as_versioned.rb:330:in clone_versioned_model' vendor/acts_as_versioned/lib/acts_as_versioned.rb:273:in save_version'

@technoweenie
Copy link
Owner

You can add missing columns to non_versioned_columns, also in the documentation. Automatic column detection like you've described would be nice if someone has a patch.

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

2 participants