active_type: incompatible with rails-5.0.0.beta2

The following code

class UserSession < ActiveType::Object
end

UserSession.new

generated

ActiveRecord::StatementInvalid: Could not find table 'objects'

error.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 19 (9 by maintainers)

Most upvoted comments

I’ll be looking into how to fix this for Rails 5 as well. The main issue is that Rails 5 already defines #attribute for ActiveRecord. Hopfully, we can simply use that and just not run our own “virtual attributes” code on Rails 5.

I’ve just released version 0.6.0, which should hopefully fix all the Rails 5 problems.

I added gemfiles/Gemfile.5.0.pg with the following:

source 'https://rubygems.org'

gem 'activerecord', '~>5.0.0'
gem 'rspec', '~>3.4'
gem 'pg'

gem 'active_type', :path => '..'

Now I have tons of warnings and some failed specs to play with, nice!

Solved it. but there is another problem about type casting. I will work on that later…