You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE public.clients (
id integer NOT NULL,
name character varying(100) NOT NULL,
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone,
slug character varying(100) NOT NULL
);
Model definition:
app/models/client.rb
class Client < ApplicationRecord
end
The text was updated successfully, but these errors were encountered:
carlosgab83
changed the title
Unsupported field datatype: timestamptz in rails admin 3.1.2
Error Starting Rails Admin: Unsupported field datatype: timestamptz in rails admin 3.1.2
Apr 12, 2023
You could monkey patch it. In order to overcome this error for our project we added a timestamptz.rb file in the folder lib/rails_admin/config/fields/types/ and we then had to require it explicitly in lib/rails_admin/config/fields/types/all.rb
The contents of timestamptz.rb can be the same as timestamp.rb
Having a postgreSQL table with a
timstamp with time zone
field type produce:Unsupported field datatype: timestamptz
error while rails_admin access the model, http://localhost:3000/client
Reproduction steps
timstamp with time zone
Expected behavior
It must accept this data type as previous versions does
Stack
Stack trace
Context
If i change the type of the field to "timestamp without time zone", it works fine, but i need the time zone.
I know this was supported because it worked with rails_admin 2 and rails 5.
Inspecting the error in the gem i can see there are not a :timestamptz key in the types registry, but :timestamp only.
rails_admin (3.1.2) lib/rails_admin/config/fields/types.rb:14
PostgresSQL table definition:
Model definition:
app/models/client.rb
The text was updated successfully, but these errors were encountered: