undefined method `inet' for #<ActiveRecord::ConnectionAdapters::TableDefinition> #63

Closed
GregPK opened this Issue Jun 29, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@GregPK

GregPK commented Jun 29, 2015

Only one test, very simple setup. Code can be found here
https://github.com/GregPK/cat_squeel-api/tree/support/broken_nulldb_issue

I'm getting an error that I don't see any reference of in the existing issues.

Failure/Error: user_new = User.new{|u| u.email = 'user1@example.com'}
     NoMethodError:
       undefined method `inet' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x000000046b9460>
     # ./db/schema.rb:28:in `block (2 levels) in <top (required)>'
     # /home/mizy/.rvm/gems/ruby-2.2.2/bundler/gems/nulldb-ed90a8c4aad6/lib/active_record/connection_adapters/nulldb_adapter/core.rb:64:in `create_table'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/migration.rb:662:in `block in method_missing'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/migration.rb:632:in `block in say_with_time'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/migration.rb:632:in `say_with_time'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/migration.rb:652:in `method_missing'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/migration.rb:417:in `method_missing'
     # ./db/schema.rb:19:in `block in <top (required)>'
     # /home/mizy/.rvm/gems/ruby-2.2.2/bundler/gems/nulldb-ed90a8c4aad6/lib/nulldb/extensions.rb:38:in `instance_eval'
     # /home/mizy/.rvm/gems/ruby-2.2.2/bundler/gems/nulldb-ed90a8c4aad6/lib/nulldb/extensions.rb:38:in `define'
     # ./db/schema.rb:14:in `<top (required)>'
     # /home/mizy/.rvm/gems/ruby-2.2.2/bundler/gems/nulldb-ed90a8c4aad6/lib/active_record/connection_adapters/nulldb_adapter/core.rb:129:in `load'
     # /home/mizy/.rvm/gems/ruby-2.2.2/bundler/gems/nulldb-ed90a8c4aad6/lib/active_record/connection_adapters/nulldb_adapter/core.rb:129:in `columns'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/connection_adapters/schema_cache.rb:43:in `columns'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/attributes.rb:93:in `columns'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/attributes.rb:98:in `columns_hash'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/inheritance.rb:205:in `subclass_from_attributes?'
     # /home/mizy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.2/lib/active_record/inheritance.rb:54:in `new'
     # ./spec/unit/models/user_spec.rb:7:in `block (3 levels) in <top (required)>'

My setup:

rails 4.2.2
rspec 3.2.3
# Included in Gemfile:
gem 'activerecord-nulldb-adapter', :git => 'git://github.com/nulldb/nulldb.git'

@collimarco

This comment has been minimized.

Show comment
Hide comment
@collimarco

collimarco Sep 10, 2016

+1 Same here.

NoMethodError: undefined method `inet' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x007f804b8ba010>
db/schema.rb:128:in `block (2 levels) in <top (required)>'
.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-nulldb-adapter-0.3.4/lib/active_record/connection_adapters/nulldb_adapter/core.rb:64:in `create_table'

Relevant schema:

create_table "users", force: :cascade do |t|
    t.inet     "current_sign_in_ip"
    t.inet     "last_sign_in_ip"
end

+1 Same here.

NoMethodError: undefined method `inet' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x007f804b8ba010>
db/schema.rb:128:in `block (2 levels) in <top (required)>'
.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-nulldb-adapter-0.3.4/lib/active_record/connection_adapters/nulldb_adapter/core.rb:64:in `create_table'

Relevant schema:

create_table "users", force: :cascade do |t|
    t.inet     "current_sign_in_ip"
    t.inet     "last_sign_in_ip"
end
@mnoack

This comment has been minimized.

Show comment
Hide comment
@mnoack

mnoack Dec 28, 2016

@GregPK @collimarco - At the moment NullDB only really works for database agnostic functions. There was an interesting PR which got somewhat close to supporting postgres specific features, but someone with postgres knowledge (not mysql) would have to rebase the PR and fill in any other possible holes in it. The PR was https://github.com/nulldb/nulldb/pull/42/files

mnoack commented Dec 28, 2016

@GregPK @collimarco - At the moment NullDB only really works for database agnostic functions. There was an interesting PR which got somewhat close to supporting postgres specific features, but someone with postgres knowledge (not mysql) would have to rebase the PR and fill in any other possible holes in it. The PR was https://github.com/nulldb/nulldb/pull/42/files

@mnoack mnoack closed this Dec 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment