smooth_operator 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDMxNTk1NWQ5YTZlNWRiZTNiNWU1ZGM3ZDc0ODRhY2FhNzkwMDNjMg==
5
+ data.tar.gz: !binary |-
6
+ YjM3ZjJhZmU2OWMzOGI5MjQ2MmNmYzFlMGY4YzBmNTY0NzRjNjk1YQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZTZmYTRlYjdlYzgxN2FmYjQzYTRhNTMwOThmMTkwZDgxZWU0YTJiNzA5Zjhh
10
+ MGJjOGE5Yjg2MThlNjU3NTI2MmM2NGI2MzE3MjQ0NDY5OTBjZTAyY2JiNDVh
11
+ MDI4NGFiOTE2MWE4ODQzNjgzYmE3ZTQzMWZkOTUwNDY2NmQ4ZWE=
12
+ data.tar.gz: !binary |-
13
+ NThhNTZiMzNkZmFhNWE5ZjA3YzAxMGM3ODU5ZDhiYzFhZDc3NTc0MzMxNDRi
14
+ MzQyYTFhMzQwOGFmMTMwNWNjZTZlYTBjOWNjMzYyNzczOTMwN2YwYWFhMTEy
15
+ NTc3MmE3OTg5MWRlZGZmM2UyM2FkNzE3ODhkYWFhZWNiZjliNDM=
@@ -50,7 +50,6 @@ module SmoothOperator
50
50
  safe_hash
51
51
  end
52
52
 
53
-
54
53
  private ######################### PRIVATE ###############################
55
54
 
56
55
  def get_nested_object_variable(nested_object_symbol, nested_object_class)
@@ -152,6 +151,21 @@ module SmoothOperator
152
151
  @table_name ||= model_name_downcase.to_s.pluralize
153
152
  end
154
153
 
154
+ def human_attribute_name(attribute_key_name, options = {})
155
+ defaults = []
156
+ defaults << "smooth_operator.attributes.#{name.underscore}.#{attribute_key_name}"
157
+ defaults << "activerecord.attributes.#{name.underscore}.#{attribute_key_name}".to_sym
158
+ defaults << options[:default] if options[:default]
159
+ defaults.flatten!
160
+ defaults << attribute_key_name.to_s.humanize
161
+ options[:count] ||= 1
162
+ I18n.translate(defaults.shift, options.merge(default: defaults))
163
+ end
164
+
165
+ def model_name
166
+ ActiveModel::Name.new represented_object_class
167
+ end
168
+
155
169
  private ################################ PRIVATE #########################
156
170
 
157
171
  def superclass_responds_to?(method_name)
@@ -1,3 +1,3 @@
1
1
  module SmoothOperator
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smooth_operator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
5
- prerelease:
4
+ version: 0.3.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - João Gonçalves
@@ -14,7 +13,6 @@ dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: httparty
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -86,27 +79,26 @@ files:
86
79
  homepage: https://github.com/goncalvesjoao/smooth_operator
87
80
  licenses:
88
81
  - MIT
82
+ metadata: {}
89
83
  post_install_message:
90
84
  rdoc_options: []
91
85
  require_paths:
92
86
  - lib
93
87
  required_ruby_version: !ruby/object:Gem::Requirement
94
- none: false
95
88
  requirements:
96
89
  - - ! '>='
97
90
  - !ruby/object:Gem::Version
98
91
  version: '0'
99
92
  required_rubygems_version: !ruby/object:Gem::Requirement
100
- none: false
101
93
  requirements:
102
94
  - - ! '>='
103
95
  - !ruby/object:Gem::Version
104
96
  version: '0'
105
97
  requirements: []
106
98
  rubyforge_project:
107
- rubygems_version: 1.8.23
99
+ rubygems_version: 2.0.7
108
100
  signing_key:
109
- specification_version: 3
101
+ specification_version: 4
110
102
  summary: Simple and fully customizable alternative to ActiveResource, based on httparty
111
103
  gem
112
104
  test_files: []