uninitialized constant #10

Closed
cmunozgar opened this Issue Apr 16, 2013 · 4 comments

4 participants

@cmunozgar

Hi, I'm trying to import a csv from a model called 'SpotStatus' and I'm getting the current error: NameError (uninitialized constant SpotStatu)

Any chance there's a fix to this?

@antonzaytsev
Collaborator

Hi cmunozgar,

looks like you did a mistake somewhere,
can you please show here your code of active admin controller where you turned on active_admin_importable?

@Blue-Dog-Archolite

I would be money that the issue is that SpotStatus has issues with pluralization.

1.9.3p194 :003 > "SpotStatus".singularize
=> "SpotStatu"
1.9.3p194 :006 > "SpotStatus".pluralize
=> "SpotStatuses"

Just a thought.

@cmunozgar

Hi,

Here is my code:

ActiveAdmin.register SpotStatus do
active_admin_importable
menu :parent => "Spots"
end

I'm with Blue-Dog-Archolite that it can be a thing with the pluralization because other Models have worked correctly!

@krhorst
Owner

Just pushed a fix to this.

Added a call to pluralize before constantize to get around the "singularizing the singular" troubles with irregular plurals (rails/rails#8671).

@krhorst krhorst closed this Apr 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment