skinny_controllers 0.7.1 → 0.7.2

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: 39dfa1641608090e03bc57064afd48ebeb983479
4
- data.tar.gz: c97efe693c6ed391c17677c8267317cf6d719bd2
3
+ metadata.gz: ba15227b9adedda091b2ab60873770d72841113a
4
+ data.tar.gz: 0785496d5b14b0b8b6d528206c6e53ea3afac60b
5
5
  SHA512:
6
- metadata.gz: 2dd9d91a0c09bdccf334c47036a494ec8a9b09788e9836582847d1e1810337f2da4d341571fa061d159d181404ebbd00e333bd4aa5de7b290d287029fd417e7a
7
- data.tar.gz: c0b861e19445fa73728f39eea3f650c50b3b8890ae99e7acfe4e25e51c76e0ca51e29c6fa79d7ec13f7fe9f032b8f869132b6ab730c67a9d724014f3f8e94578
6
+ metadata.gz: e18a2022b30e4ce519424d2e4338466baf1dbc96510a99a84b741394ece1d7f999d1b27b666002fb8077f67aa9fc5e16f2118f11448a6a9b392e4a188c0c1b37
7
+ data.tar.gz: 25a46fa59a9aabddb3f58c535ca02e17845dd01c0af00abecca0414854b8817c77e9a73eb27e36bce6b4e88a6f736137618a3cc9ba46a35b0288a55606597e0d
@@ -54,8 +54,13 @@ module SkinnyControllers
54
54
  @object_type_name ||= Lookup::Model.name_from_operation(self.class.name)
55
55
  end
56
56
 
57
+ # @example model_name == Namespace::Item
58
+ # -> model_name.tableize == namespace/items
59
+ # -> split.last == items
60
+ #
61
+ # TODO: maybe make this configurable?
57
62
  def association_name_from_object
58
- model_name.tableize
63
+ model_name.tableize.split('/').last
59
64
  end
60
65
 
61
66
  # Takes the class name of self and converts it to a Policy class name
@@ -82,7 +82,7 @@ module SkinnyControllers
82
82
  end
83
83
 
84
84
  def model_from_named_id(key, id)
85
- name, _id = key.split('_')
85
+ name = key.gsub(/_id$/, '')
86
86
  name = name.camelize
87
87
  model_from_scope(
88
88
  id: id,
@@ -1,3 +1,3 @@
1
1
  module SkinnyControllers
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skinny_controllers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - L. Preston Sego III
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-30 00:00:00.000000000 Z
11
+ date: 2016-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -222,8 +222,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  version: '0'
223
223
  requirements: []
224
224
  rubyforge_project:
225
- rubygems_version: 2.5.1
225
+ rubygems_version: 2.4.8
226
226
  signing_key:
227
227
  specification_version: 4
228
- summary: SkinnyControllers-0.7.1
228
+ summary: SkinnyControllers-0.7.2
229
229
  test_files: []