Commit Graph

5 Commits

Author SHA1 Message Date
Javi Martín
574bd87b08 Remove unused (and flaky) card code and its spec
This code was introduced in commit 722a431b, but it stopped being used
in commit 7657a0e0.

The spec was failing sometimes because the method didn't order the
records, but the spec checked the records returned in a certain order.

Furthermore, the method `page` generated a potential conflict with
kaminari's `page method.
2019-05-10 15:21:58 +02:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Javi Martín
2926e4e375 Fix managing widget cards for homepage
The condition `params[:page_id] != 0` didn't work properly when editing
the homepage because in that case the parameter was `nil`, and the line
`SiteCustomization::Page.find(@card.site_customization_page_id)` raised
an exception because it couldn't find a page with a `nil` ID.

Fixing the issue while maintaining the check against `0` lead to complex
code, and so allowing `nil` in the database and assuming cards with no
`site_customization_page_id` belonged in the homepage seemed to be the
easiest solution.
2019-01-21 10:40:14 -05:00
Manu
162b61f94c updated test file for cards 2019-01-18 09:54:43 -05:00
rgarcia
664e77305c Add widget cards to homepage 2018-05-28 18:17:26 +02:00