ruby - ActiveRecord NullDB adapter not loading tables/columns -
i trying use nulldb database adapter create/run specs external database. dont want query external database specs want use nulldb instead.
the problem is: created seperate schema.rb
file should used nulldb, set nulldb adapter , schema.rb
path in config test env, but, models dont have columns, therefore methods name=
failing.
nulldb reads out schema correct , creates tables columns.
nulldbnamespace::product.columns (4.2ms) drop table "products" (9.8ms) create table "products" ("id" serial primary key, "products_id" integer, "products_model" integer, "products_master" integer, "manufacturers_id" integer, "products_tax_class_id" integer, "products_quantity" integer, "products_evp" decimal(16,8), "products_ean" character varying) (3.1ms) drop table "descriptions" (7.1ms) create table "descriptions" ("id" serial primary key, "products_id" integer, "language_id" integer, "products_name" character varying, "products_description" text) (3.1ms) drop table "languages" (5.9ms) create table "languages" ("id" serial primary key, "languages_id" integer, "name" character varying, "code" character varying)
but get
nulldbnamespace::product.columns => []
also there no tables connection:
nulldbnamespace::product.connection.tables => ["schema_info"]
does has idea?
Comments
Post a Comment