bogdan / datagrid

Gem to create tables grids with sortable columns and filters
MIT License
1.02k stars 115 forks source link

Undefined method error in Datagrid::Utils. property_availability when using conditional (:if, :unless) column options #238

Closed jsimpson closed 6 years ago

jsimpson commented 6 years ago

Very contrived example code which will trigger the exception:

class SomeGrid
  include Datagrid

  scope { SomeModel }

  column(:name, :if => true) do |model, grid|
    ...
  end
end

Exception message: undefined methodinsepct' for true:TrueClass`.

Comes from a typo in utils.rb:150.

I stumbled across this as a result of my own typo in the column declaration.