20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/refinery/crud.rb', line 20
def self.default_options(model_name)
class_name = "#{model_name.to_s.camelize.gsub('/', '::')}".gsub('::::', '::')
this_class = class_name.constantize.base_class
singular_name = ActiveModel::Naming.param_key(this_class)
plural_name = singular_name.pluralize
{
conditions: '',
include: [],
order: ('position ASC' if this_class.connected? && this_class.table_exists? && this_class.column_names.include?('position')),
paging: true,
per_page: false,
redirect_to_url: "refinery.#{Refinery.route_for_model(class_name.constantize, :plural => true)}",
searchable: true,
search_conditions: '',
sortable: true,
title_attribute: "title",
class_name: class_name,
singular_name: singular_name,
plural_name: plural_name,
find_actions: [:update, :destroy, :edit, :show],
exclude_from_find: []
}
end
|