railsdog/spree_landlord — pull request #7 by jsqu99 (2013-02-07 01:05:22+00:00)
Title: Fix abilities for accessible by

Scott,

I screwed up and accidentally have two commits here. The 2nd one I'd like for you to take a really good look at if you don't mind.

I left this in your skype window:

i'm actually thinking about reworking it due to a cancan exception:
https://github.com/ryanb/cancan/wiki/Defining-Abilities-with-Blocks

look at the 'fetching records' section

there's an
@search = Order.accessible_by(current_ability, :index).ransack(params[:q]) in the admin orders_controller

that chokes b/c the ability was defined using a block...so i'm thinking of reworking using a hash

and i want to confirm the comment i authored above that section is correct:
# if you are not a super_admin, you can not do
# _anything_ to a super_admin Spree::User