rails_rad 1.1.0 → 1.1.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
  SHA1:
3
- metadata.gz: 73a86163792f274451de4432bbf78b2741127df2
4
- data.tar.gz: feb65ca8e0780fbcccfa97676d98087410cb6f22
3
+ metadata.gz: bae6a2b764ea36d569c5adc0afab26939cd28680
4
+ data.tar.gz: 696acd295c593bd6db377359d49731c7141a8de0
5
5
  SHA512:
6
- metadata.gz: 4507f6e26a9c5faaef48e94c59cd4f32d712df9284548044890a8fb9fd69dfcae0c2a0d9b0122a5280ddd00e596687374ef01edd558452f9e06aa67a3edff097
7
- data.tar.gz: b9eb44549538830fc079540963258a84ef376f50610c79979635cf5b6c8975a52c7e181d5fe370aba0a68812291a82773e9f6f14779778f80bf24fe9c3e27bca
6
+ metadata.gz: a74dcba9c462426f9e0aaa1d865ceaa78b6452fe32b9e4c1435a8682715f40555ee580a5084f2d46a41dd4f2879b07890517f0db5ea3b4a6c62f3d0a3b6f1d26
7
+ data.tar.gz: a35d74f5a7e3856b40c1d959113c5ef49a66f3ee9ea9ba56987ebb49a8a5b22eb640507a853965b929477425d15645d1aa8112c6f433e5eb0edad0920f6fbcda
@@ -18,11 +18,15 @@ module Controller
18
18
  end
19
19
 
20
20
  def edit_resource_path(resource)
21
- url_for(controller: controller_path, action: :edit, id: resource.to_param)
21
+ url_for(controller: controller_path, action: :edit, id: resource.send(to_param_method))
22
22
  end
23
23
 
24
24
  def resource_path(resource)
25
- url_for(controller: controller_path, action: :show, id: resource.to_param)
25
+ url_for(controller: controller_path, action: :show, id: resource.send(to_param_method))
26
+ end
27
+
28
+ def to_param_method
29
+ :to_param
26
30
  end
27
31
  end
28
32
  end
@@ -61,8 +61,12 @@ module Controller
61
61
  collection_scope
62
62
  end
63
63
 
64
+ def load_scope
65
+ resource_class
66
+ end
67
+
64
68
  def load_resource
65
- resource_class.find(params[:id])
69
+ load_scope.find(params[:id])
66
70
  end
67
71
  end
68
72
  end
@@ -28,7 +28,11 @@ module Controller
28
28
  private
29
29
 
30
30
  def initialize_service
31
- service_class.new
31
+ if params[service_class.name.demodulize.underscore.to_sym].nil?
32
+ service_class.new
33
+ else
34
+ service_class.new(permitted_params)
35
+ end
32
36
  end
33
37
 
34
38
  def prepare_service
@@ -1,3 +1,3 @@
1
1
  module RailsRad
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_rad
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -113,3 +113,4 @@ signing_key:
113
113
  specification_version: 4
114
114
  summary: Rails Rapid Application Development Tools
115
115
  test_files: []
116
+ has_rdoc: