wheelmap-classic
wheelmap-classic copied to clipboard
Cannot create region via ActiveAdmin
Right now creating a new region is not possible via ActiveAdmin. The form under http://localhost:3000/admin/regions
only offers a name field. My guess here is that not all mandatory fields are present.
The transaction gets rolled back on insert:
AdminUser Load (0.4ms) SELECT `admin_users`.* FROM `admin_users` WHERE `admin_users`.`id` = 11 LIMIT 1
(0.1ms) BEGIN
Region Load (0.4ms) SELECT `regions`.* FROM `regions` WHERE (`slug` = 'dis' OR `slug` LIKE 'dis--%') ORDER BY LENGTH(`slug`) DESC, `slug` DESC LIMIT 1
(0.1ms) ROLLBACK
Rendered vendor/bundle/ruby/2.2.0/gems/activeadmin-1.0.0.pre2/app/views/active_admin/resource/new.html.arb (59.5ms)
Completed 200 OK in 89.0ms (Views: 66.1ms | ActiveRecord: 0.0ms)
@holgerd will find out if we'll need this feature in the wheelmap app at all.
The problem here is that it probably won't be possible to create a region via the ActiveAdmin form because a region requires a GEOMETRY
object in order to be valid. I'm not sure if it makes sense to have some text field in place where there user needs to type in some string like POLYGON ((10 10, 110 10, 110 110, 10 110))
.