rest-in-peace 4.1.1 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rest_in_peace/active_model_api.rb +1 -4
- data/spec/rest_in_peace/active_model_api_spec.rb +12 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.2.0
|
@@ -15,16 +15,13 @@ module RESTinPeace
|
|
15
15
|
|
16
16
|
base.send(:include, ActiveModel::Conversion)
|
17
17
|
base.extend ActiveModel::Naming
|
18
|
+
base.extend ActiveModel::Translation
|
18
19
|
|
19
20
|
base.send(:alias_method, :save_without_dirty_tracking, :save)
|
20
21
|
base.send(:alias_method, :save, :save_with_dirty_tracking)
|
21
22
|
base.send(:alias_method, :create_without_dirty_tracking, :create)
|
22
23
|
base.send(:alias_method, :create, :create_with_dirty_tracking)
|
23
24
|
|
24
|
-
def base.human_attribute_name(attr, options = {})
|
25
|
-
attr.to_s
|
26
|
-
end
|
27
|
-
|
28
25
|
def base.lookup_ancestors
|
29
26
|
[self]
|
30
27
|
end
|
@@ -84,8 +84,13 @@ describe RESTinPeace do
|
|
84
84
|
end
|
85
85
|
|
86
86
|
describe 'validation handling' do
|
87
|
+
before do
|
88
|
+
def extended_class.model_name
|
89
|
+
ActiveModel::Name.new(self, nil, 'TemporaryClassForTests')
|
90
|
+
end
|
91
|
+
end
|
87
92
|
specify { expect(extended_class).to respond_to(:human_attribute_name).with(2).arguments }
|
88
|
-
specify { expect(extended_class.human_attribute_name(:description)).to eq('
|
93
|
+
specify { expect(extended_class.human_attribute_name(:description)).to eq('Description') }
|
89
94
|
|
90
95
|
specify { expect(extended_class).to respond_to(:lookup_ancestors).with(0).arguments }
|
91
96
|
specify { expect(extended_class.lookup_ancestors).to eq([extended_class]) }
|
@@ -164,6 +169,12 @@ describe RESTinPeace do
|
|
164
169
|
end
|
165
170
|
|
166
171
|
describe 'validation handling' do
|
172
|
+
before do
|
173
|
+
def extended_class.model_name
|
174
|
+
ActiveModel::Name.new(self, nil, 'TemporaryClassForTests')
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
167
178
|
let(:description) { 'desc' }
|
168
179
|
let(:errors) { { description: ['must not be empty'] } }
|
169
180
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-in-peace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|