I found ActiveAdmin very useful for creating rather full-brown scaffold for our ActiveRecord models. However, our models have float (and some decimal) columns and ActiveAdmin fails to create filters for them.
For example,
ActiveAdmin.register ForexRate do
filter :rate, :as => :numeric
end
gives me NoMethodError, saying
undefined method `rate_gt' for #<MetaSearch::Searches::ForexRate:0x007fa4427bb018>
What am I doing wrong here? Thanks in advance!
P.S. I have confirmed the same filter worked for integer columns.
Looks like the issue was from my table having
rateasREALinstead ofFLOATorDECIMAL(x,y). Changing it to either FLOAT or DECIMAL fixed the issue.It is also interesting to observe that, when the column is REAL, or other unrecognizable type, ActiveRecord::Base#inspect becomes:
(Notice the blank next to
rate:)