tramway-admin 1.12 → 1.12.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a503c8ac204e6d2d36cbbe4168b72f0ce843fc744cda0c6fb3106082de4cc701
4
- data.tar.gz: 76a0541f594c9a3eb2a22cfd3f500a0674af4f8bf54219538716ccc7fda2e999
3
+ metadata.gz: 9eae42074a988ca816a21d71c0f9c6d3ac0b46f31399f6da7091fbfd408f7f17
4
+ data.tar.gz: c56b19d4085c23245827bba64e7e56f62074b6d2a42e51d329bd37f08b4c206f
5
5
  SHA512:
6
- metadata.gz: 77d5cb62cdf5700b915c0c8c870290f47c236d5bcbb4889effc7db5f4db3df0d8f9deb552a582bf0fc192ac9a3c98deef5afbd97a2bb7d0f80853ff5e8ddcffe
7
- data.tar.gz: cf97934893fec436f5ade4751f8049738d94b40bf466bdd8621e68abf103a07da8400a476ac4efdc65cc71bd78e6920841c49bfdeb1dae46242b0d85e3002290
6
+ metadata.gz: 998547d17902ac7ac720647bab7b53eb382a30df2e375d6b77febbe9742a0feafe51fa7f914d520f80cda0db12e72da2d390d11ee2eca903fd7750abb684275d
7
+ data.tar.gz: 21d83f7463ea824b958c3ea8f8efb9813cc6134bd6380999d79128833e4557c63aa2ac1ff4668800e22011e033cb74b9240343fb4258af79f1a4eedd29105339
@@ -44,8 +44,6 @@ module Tramway
44
44
  end
45
45
  end
46
46
 
47
- private
48
-
49
47
  include Tramway::ClassNameHelpers
50
48
 
51
49
  def model_class
@@ -1,65 +1,63 @@
1
- module Tramway::Admin
2
- class RecordsController < ApplicationController
3
- def index
4
- scope = params[:scope].present? ? params[:scope] : :all
5
- records = model_class.active.order(id: :desc).send scope
6
- records = records.search params[:search] if params[:search]
7
- @records = decorator_class.decorate records.page params[:page]
8
- end
1
+ class Tramway::Admin::RecordsController < ::Tramway::Admin::ApplicationController
2
+ def index
3
+ scope = params[:scope].present? ? params[:scope] : :all
4
+ records = model_class.active.order(id: :desc).send scope
5
+ records = records.search params[:search] if params[:search]
6
+ @records = decorator_class.decorate records.page params[:page]
7
+ end
9
8
 
10
- def show
11
- @record = decorator_class.decorate model_class.active.find params[:id]
12
- end
9
+ def show
10
+ @record = decorator_class.decorate model_class.active.find params[:id]
11
+ end
13
12
 
14
- def edit
15
- @record_form = form_class.new model_class.active.find params[:id]
16
- end
13
+ def edit
14
+ @record_form = form_class.new model_class.active.find params[:id]
15
+ end
17
16
 
18
- def update
19
- @record_form = form_class.new model_class.active.find params[:id]
20
- if @record_form.submit params[:record]
21
- redirect_to params[:redirect] || record_path(@record_form.model)
22
- else
23
- render :edit
24
- end
17
+ def update
18
+ @record_form = form_class.new model_class.active.find params[:id]
19
+ if @record_form.submit params[:record]
20
+ redirect_to params[:redirect] || record_path(@record_form.model)
21
+ else
22
+ render :edit
25
23
  end
24
+ end
26
25
 
27
- def new
28
- @record_form = form_class.new model_class.new
29
- end
26
+ def new
27
+ @record_form = form_class.new model_class.new
28
+ end
30
29
 
31
- def create
32
- @record_form = form_class.new
33
- if @record_form.submit params[:record]
34
- redirect_to params[:redirect] || record_path(@record_form.model)
35
- else
36
- render :new
37
- end
30
+ def create
31
+ @record_form = form_class.new
32
+ if @record_form.submit params[:record]
33
+ redirect_to params[:redirect] || record_path(@record_form.model)
34
+ else
35
+ render :new
38
36
  end
37
+ end
39
38
 
40
- def destroy
41
- record = model_class.active.find params[:id]
42
- record.remove
43
- redirect_to records_path
44
- end
39
+ def destroy
40
+ record = model_class.active.find params[:id]
41
+ record.remove
42
+ redirect_to records_path
45
43
  end
44
+ end
46
45
 
47
- private
46
+ private
48
47
 
49
- # FIXME replace to module
50
- def record_path(*args, **options)
51
- super args, options.merge(model: params[:model])
52
- end
48
+ # FIXME replace to module
49
+ def record_path(*args, **options)
50
+ super args, options.merge(model: params[:model])
51
+ end
53
52
 
54
- def edit_record_path(*args, **options)
55
- super args, options.merge(model: params[:model])
56
- end
53
+ def edit_record_path(*args, **options)
54
+ super args, options.merge(model: params[:model])
55
+ end
57
56
 
58
- def new_record_path(*args, **options)
59
- super args, options.merge(model: params[:model])
60
- end
57
+ def new_record_path(*args, **options)
58
+ super args, options.merge(model: params[:model])
59
+ end
61
60
 
62
- def records_path(*args, **options)
63
- super args, options.merge(model: params[:model])
64
- end
61
+ def records_path(*args, **options)
62
+ super args, options.merge(model: params[:model])
65
63
  end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Admin
3
- VERSION = '1.12'
3
+ VERSION = '1.12.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.12'
4
+ version: 1.12.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-15 00:00:00.000000000 Z
11
+ date: 2019-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-kaminari-views
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  version: '0'
273
273
  requirements: []
274
274
  rubyforge_project:
275
- rubygems_version: 2.7.6
275
+ rubygems_version: 2.7.7
276
276
  signing_key:
277
277
  specification_version: 4
278
278
  summary: Engine for admin