Merge branch 'development' of github.com:Rulingcom/orbit into development
Conflicts: lib/tasks/migrate.rake
This commit is contained in:
commit
ca946fc881
|
@ -32,11 +32,11 @@ class DefaultWidgetController< OrbitWidgetController
|
|||
end
|
||||
|
||||
def default_widget
|
||||
|
||||
if !params[:id].blank?
|
||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method['title']['method']}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||
else
|
||||
@tag_class = nil
|
||||
|
||||
@default_widget = @page_part.module_app.get_default_widget
|
||||
@widget_image_field = @default_widget["image"] || @default_widget[:image]
|
||||
case @page_part
|
||||
|
@ -50,9 +50,11 @@ class DefaultWidgetController< OrbitWidgetController
|
|||
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||
end
|
||||
if @paginate
|
||||
@data = eval(@default_widget["query"]).includes(@widget_image_field).page(params[:page_main]).per(@data_limit).desc(:created_at)
|
||||
@data = query_for_default_widget.includes(@widget_image_field).page(params[:page_main]).per(@data_limit)
|
||||
# @data = query_for_default_widget.limit(@data_limit).includes(@widget_image_field)
|
||||
else
|
||||
@data = eval(@default_widget["query"]).limit(@data_limit).includes(@widget_image_field).desc(:created_at)
|
||||
@data = eval(@default_widget["query"]).includes(@widget_image_field).page(params[:page_main]).per(@data_limit).desc(:created_at)
|
||||
# @data = eval(@default_widget["query"]).limit(@data_limit).includes(@widget_image_field).desc(:created_at)
|
||||
end
|
||||
case params[:type]
|
||||
when "typeA"
|
||||
|
|
Loading…
Reference in New Issue