Module: ActiveScaffold::Bridges::Cancan::Actions::Core

Defined in:
lib/active_scaffold/bridges/cancan/cancan_bridge.rb

Instance Method Summary collapse

Instance Method Details

#beginning_of_chainObject

:TODO can this be expanded more ?



45
46
47
# File 'lib/active_scaffold/bridges/cancan/cancan_bridge.rb', line 45

def beginning_of_chain
  super.accessible_by(current_ability)
end

#new_modelObject

fix when ability allow access base on id can [:manage], Client, id: Client.of_employee(user).pluck(:id)



51
52
53
# File 'lib/active_scaffold/bridges/cancan/cancan_bridge.rb', line 51

def new_model
  super.tap { |record| record.id = nil }
end