midas-g_named_scope_filters 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/g_named_scope_filters.gemspec +1 -1
- data/lib/g_named_scope_filters.rb +1 -1
- data/lib/g_named_scope_filters/view_helpers.rb +8 -10
- metadata +1 -1
data/History.txt
CHANGED
@@ -41,9 +41,9 @@ module GNamedScopeFilters
|
|
41
41
|
end
|
42
42
|
options[:filters] = filters
|
43
43
|
|
44
|
-
scoped_by = options[:scoped_by]
|
45
|
-
polymorphic_type = options[:polymorphic_type]
|
46
|
-
polymorphic_as = options[:polymorphic_as]
|
44
|
+
scoped_by = options[:scoped_by]
|
45
|
+
polymorphic_type = options[:polymorphic_type]
|
46
|
+
polymorphic_as = options[:polymorphic_as]
|
47
47
|
|
48
48
|
raise "You must provide the 'polymorphic_as' option if you provide the 'polymorphic_type' option." if polymorphic_type && !polymorphic_as
|
49
49
|
|
@@ -63,18 +63,16 @@ module GNamedScopeFilters
|
|
63
63
|
|
64
64
|
path_helpers = Guilded::Rails::Helpers.resolve_rest_path_helpers( ar_obj_col_or_class, options )
|
65
65
|
list_path_helper = path_helpers[:index_rest_helper]
|
66
|
-
#if options[:list_path_helper]
|
67
|
-
# list_path_helper = options[:list_path_helper].to_s
|
68
|
-
#elsif scoped_by
|
69
|
-
# list_path_helper = "#{scoped_by.class.to_s.underscore}_#{klass.to_s.tableize}_path"
|
70
|
-
#else
|
71
|
-
# list_path_helper = "#{klass.to_s.tableize}_path"
|
72
|
-
#end
|
73
66
|
|
74
67
|
html = ''
|
75
68
|
|
76
69
|
return html if filters.empty?
|
77
70
|
|
71
|
+
# Resolve scoped by if it is an array
|
72
|
+
if scoped_by.is_a?( Array )
|
73
|
+
scoped_by = scoped_by.last
|
74
|
+
end
|
75
|
+
|
78
76
|
html << "<ul id=\"#{options[:id].to_s}\" class=\"#{options[:class].to_s}\">"
|
79
77
|
|
80
78
|
# Handle the all filter
|