Class: Resources::TableSettingResource

Inherits:
ApiMaker::BaseResource
  • Object
show all
Defined in:
app/api_maker/resources/table_setting_resource.rb

Instance Method Summary collapse

Instance Method Details

#abilitiesObject



7
8
9
10
11
# File 'app/api_maker/resources/table_setting_resource.rb', line 7

def abilities
  puts "Allow creating table for: #{{user_id: current_user.id, user_type: current_user.class.name}}"

  can CRUD, ApiMakerTable::TableSetting, user_id: current_user.id, user_type: current_user.class.name if current_user
end

#permitted_params(arg) ⇒ Object



13
14
15
16
17
18
19
20
# File 'app/api_maker/resources/table_setting_resource.rb', line 13

def permitted_params(arg)
  arg.params.require(:table_setting).permit(
    :identifier,
    :user_id,
    :user_type,
    columns_attributes: [:attribute_name, :id, :identifier, :path, :position, :sort_key, :visible]
  )
end