Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

#1731 adding ability to set :id, :created_at, :updated_at

  • Loading branch information...
commit e14a248b653e458d06ab0d8aa108aac487d6bb68 1 parent 98fc1c0
Gary S. Weaver authored
Showing with 5 additions and 7 deletions.
  1. +5 −7 lib/active_admin/strong_parameters_patch.rb
12 lib/active_admin/strong_parameters_patch.rb
View
@@ -8,13 +8,11 @@ def initialize
@klass = active_admin_config.resource_name.constantize
@column_names = @klass.columns.map do |column|
- unless [:id, :created_at, :updated_at].include?(column.name.to_sym)
- case column.type
- when :datetime, :date, :time
- ([column.name.to_sym] + (1..5).inject([]) { |acc, x| acc << :"#{column.name}(#{x}i)" })
- else
- column.name.to_sym
- end
+ case column.type
+ when :datetime, :date, :time
+ ([column.name.to_sym] + (1..5).inject([]) { |acc, x| acc << :"#{column.name}(#{x}i)" })
+ else
+ column.name.to_sym
end
end.flatten
Please sign in to comment.
Something went wrong with that request. Please try again.