diff options
| author | Luc Donnet | 2015-01-07 21:58:56 +0100 |
|---|---|---|
| committer | Luc Donnet | 2015-01-07 21:58:56 +0100 |
| commit | baaed4653623cfc918ada7250c4fd879aad28893 (patch) | |
| tree | ec1e7da111c2ccd95f82013e2d40d6b455f80815 /app/controllers/referentials_controller.rb | |
| parent | c39887f2e4f6a12ab3af205c58a1330d8b28f5e9 (diff) | |
| download | chouette-core-baaed4653623cfc918ada7250c4fd879aad28893.tar.bz2 | |
Fix spec and update devise usage
Diffstat (limited to 'app/controllers/referentials_controller.rb')
| -rw-r--r-- | app/controllers/referentials_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index 9cf4a5f62..643c780a4 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -25,18 +25,25 @@ class ReferentialsController < BreadcrumbController def resource @referential ||= current_organisation.referentials.find_by_id(params[:id]) end + def collection @referentials ||= current_organisation.referentials.order(:name) end + def build_resource super.tap do |referential| referential.user_id = current_user.id referential.user_name = current_user.name end end + def create_resource(referential) referential.organisation = current_organisation super end + def permitted_params + params.permit(referential: [ :name, :slug, :prefix, :time_zone, :upper_corner, :lower_corner, :organisation_id ]) + end + end |
