active_model-better_errors 1.6.5 → 1.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/.gemrelease +2 -0
  3. data/Gemfile +2 -0
  4. data/Gemfile.devtools +7 -4
  5. data/README.md +4 -0
  6. data/Rakefile +1 -0
  7. data/lib/active_model/better_errors/human_message_formatter.rb +1 -1
  8. data/lib/active_model/better_errors/version.rb +1 -1
  9. data/spec/integration/integration_spec.rb +23 -0
  10. data/spec/support/active_record.rb +28 -0
  11. data/spec/unit/{lib/active_model → active_model}/better_errors/emulation_spec.rb +0 -0
  12. data/spec/unit/{lib/active_model → active_model}/better_errors/error_collection_spec.rb +0 -0
  13. data/spec/unit/{lib/active_model → active_model}/better_errors/error_message_set_spec.rb +0 -0
  14. data/spec/unit/{lib/active_model → active_model}/better_errors/error_message_spec.rb +0 -0
  15. data/spec/unit/{lib/active_model → active_model}/better_errors/errors_spec.rb +0 -0
  16. data/spec/unit/{lib/active_model → active_model}/better_errors/human_array_reporter_spec.rb +0 -0
  17. data/spec/unit/{lib/active_model → active_model}/better_errors/human_hash_reporter_spec.rb +0 -0
  18. data/spec/unit/{lib/active_model → active_model}/better_errors/human_message_formatter_spec.rb +0 -0
  19. data/spec/unit/{lib/active_model → active_model}/better_errors/human_message_reporter_spec.rb +0 -0
  20. data/spec/unit/{lib/active_model → active_model}/better_errors/machine_array_reporter_spec.rb +0 -0
  21. data/spec/unit/{lib/active_model → active_model}/better_errors/machine_hash_reporter_spec.rb +0 -0
  22. data/spec/unit/{lib/active_model → active_model}/better_errors_spec.rb +0 -0
  23. metadata +32 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc0ae92c62128a09b3ee6b99d4a499b5d8032278
4
- data.tar.gz: 862976ec72f2889be16d8728e94a41f687e3b405
3
+ metadata.gz: 3eda02afda0d00f8f4863afd7b05a6d27a87389a
4
+ data.tar.gz: 183cb8e8cdc6e19963351449a43180b432d03207
5
5
  SHA512:
6
- metadata.gz: 09feb3000c86545ccd60408559c3817e5d3134b49975b3a2190d6f51486d4ae24b7a43f0a44caabcfc820bf9b50f989d64cc76f5395707730d5de3b0fdd905f1
7
- data.tar.gz: 52be60470b25c0ebf7b87312057873c2ecc0e10a5a4f269ae97f63d47f61ef0d107a4488a5c29743b1e66dc908cacd86aaf8fca564b4bb3ec425b777bf60c7a5
6
+ metadata.gz: 09ecea7e26609e17d878e8bb97111ed6312e7163ddeb3bc9daa2ac033c719d74ceaeac33f178cb5a7eabaafe00d6f2bc604c6e9eba8238a6eba0e6ab8d17a452
7
+ data.tar.gz: 406871bb5e23427115d8293575585826b4f983996702addbaab6da0b4ac6ab7d8ff28a7b5beb44813e8955194e084f1505f71154877189a2dd92bde3d7b0163d
@@ -0,0 +1,2 @@
1
+ bump:
2
+ tag: true
data/Gemfile CHANGED
@@ -7,6 +7,8 @@ gemspec
7
7
  group :development do
8
8
  gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
9
9
  gem 'gem-release'
10
+ gem 'activerecord', '~> 4.0.2'
11
+ gem 'sqlite3'
10
12
  end
11
13
 
12
14
  # Added by devtools
@@ -15,7 +15,7 @@ group :yard do
15
15
  end
16
16
 
17
17
  group :guard do
18
- gem 'guard', '~> 2.2.4'
18
+ gem 'guard', '~> 2.3.0'
19
19
  gem 'guard-bundler', '~> 2.0.0'
20
20
  gem 'guard-rspec', '~> 4.2.0'
21
21
  gem 'guard-rubocop', '~> 1.0.0'
@@ -39,16 +39,19 @@ group :metrics do
39
39
  gem 'reek', '~> 1.3.2'
40
40
  gem 'rubocop', '~> 0.16.0'
41
41
  gem 'simplecov', '~> 0.8.2'
42
- gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'
42
+ gem 'yardstick', '~> 0.9.9'
43
+
44
+ platforms :mri do
45
+ gem 'mutant', '~> 0.3.4'
46
+ end
43
47
 
44
48
  platforms :ruby_19, :ruby_20 do
45
- gem 'mutant', '~> 0.3.4'
46
49
  gem 'yard-spellcheck', '~> 0.1.5'
47
50
  end
48
51
 
49
52
  platform :rbx do
50
53
  gem 'json', '~> 1.8.1'
51
- gem 'racc', '~> 1.4.10'
54
+ gem 'racc', '~> 1.4'
52
55
  gem 'rubysl-logger', '~> 2.0.0'
53
56
  gem 'rubysl-open-uri', '~> 2.0.0'
54
57
  gem 'rubysl-prettyprint', '~> 2.0.2'
data/README.md CHANGED
@@ -183,3 +183,7 @@ ActiveModel::BetterErrors.set_reporter :hash, MyHashReporter
183
183
  Copyright (c) 2013 Aaron Qian. See LICENSE.txt for
184
184
  further details.
185
185
 
186
+
187
+
188
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/aq1018/active_model-better_errors/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
189
+
data/Rakefile CHANGED
@@ -21,6 +21,7 @@ task :default => [
21
21
  # 'metrics:reek',
22
22
 
23
23
  # run spec and generate coverage
24
+ 'spec',
24
25
  'metrics:coverage',
25
26
 
26
27
  # We need to kill all mutants before enabling this for ci
@@ -7,7 +7,7 @@ module ActiveModel
7
7
  #
8
8
  class HumanMessageFormatter < Formatter
9
9
  def format_message
10
- return message if message && type.nil?
10
+ return message if message # && type.nil?
11
11
 
12
12
  keys = i18n_keys
13
13
  key = keys.shift
@@ -5,6 +5,6 @@ module ActiveModel
5
5
  # BetterErrors
6
6
  #
7
7
  module BetterErrors
8
- VERSION = '1.6.5'
8
+ VERSION = '1.6.6'
9
9
  end
10
10
  end
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe ActiveModel::BetterErrors do
6
+ describe 'should work for ActiveRecord::AutosaveAssociation' do
7
+ let(:car) { Car.create(make: 'bmw', model: 'm3') }
8
+
9
+ before do
10
+ car.doors.create(position: 'left')
11
+ car.doors.create(position: 'right')
12
+ car.reload
13
+ end
14
+
15
+ it 'should create error object on save' do
16
+ car.doors[0].position = 'on the roof'
17
+ expect(car.changed_for_autosave?).to be_true
18
+ car.save
19
+
20
+ expect(car.errors).not_to be_nil
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,28 @@
1
+ require 'active_record'
2
+
3
+ ActiveRecord::Base.establish_connection(
4
+ adapter: 'sqlite3',
5
+ database: ':memory:'
6
+ )
7
+
8
+ ActiveRecord::Migration.create_table :cars do |t|
9
+ t.string :make
10
+ t.string :model
11
+ end
12
+
13
+ ActiveRecord::Migration.create_table :doors do |t|
14
+ t.references :car
15
+ t.string :position
16
+ end
17
+
18
+ # :nodoc:
19
+ class Car < ActiveRecord::Base
20
+ has_many :doors, autosave: true
21
+ end
22
+
23
+ # :nodoc:
24
+ class Door < ActiveRecord::Base
25
+ belongs_to :car
26
+
27
+ validates_inclusion_of :position, in: %w(left right)
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model-better_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Qian
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-12 00:00:00.000000000 Z
12
+ date: 2014-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -131,6 +131,7 @@ executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
+ - .gemrelease
134
135
  - .gitignore
135
136
  - .gitmodules
136
137
  - .rspec
@@ -168,22 +169,24 @@ files:
168
169
  - lib/active_model/better_errors/message_reporter.rb
169
170
  - lib/active_model/better_errors/reporter.rb
170
171
  - lib/active_model/better_errors/version.rb
172
+ - spec/integration/integration_spec.rb
171
173
  - spec/spec_helper.rb
174
+ - spec/support/active_record.rb
172
175
  - spec/support/i18n_deprecation_silence.rb
173
176
  - spec/support/models.rb
174
177
  - spec/support/string_ext.rb
175
- - spec/unit/lib/active_model/better_errors/emulation_spec.rb
176
- - spec/unit/lib/active_model/better_errors/error_collection_spec.rb
177
- - spec/unit/lib/active_model/better_errors/error_message_set_spec.rb
178
- - spec/unit/lib/active_model/better_errors/error_message_spec.rb
179
- - spec/unit/lib/active_model/better_errors/errors_spec.rb
180
- - spec/unit/lib/active_model/better_errors/human_array_reporter_spec.rb
181
- - spec/unit/lib/active_model/better_errors/human_hash_reporter_spec.rb
182
- - spec/unit/lib/active_model/better_errors/human_message_formatter_spec.rb
183
- - spec/unit/lib/active_model/better_errors/human_message_reporter_spec.rb
184
- - spec/unit/lib/active_model/better_errors/machine_array_reporter_spec.rb
185
- - spec/unit/lib/active_model/better_errors/machine_hash_reporter_spec.rb
186
- - spec/unit/lib/active_model/better_errors_spec.rb
178
+ - spec/unit/active_model/better_errors/emulation_spec.rb
179
+ - spec/unit/active_model/better_errors/error_collection_spec.rb
180
+ - spec/unit/active_model/better_errors/error_message_set_spec.rb
181
+ - spec/unit/active_model/better_errors/error_message_spec.rb
182
+ - spec/unit/active_model/better_errors/errors_spec.rb
183
+ - spec/unit/active_model/better_errors/human_array_reporter_spec.rb
184
+ - spec/unit/active_model/better_errors/human_hash_reporter_spec.rb
185
+ - spec/unit/active_model/better_errors/human_message_formatter_spec.rb
186
+ - spec/unit/active_model/better_errors/human_message_reporter_spec.rb
187
+ - spec/unit/active_model/better_errors/machine_array_reporter_spec.rb
188
+ - spec/unit/active_model/better_errors/machine_hash_reporter_spec.rb
189
+ - spec/unit/active_model/better_errors_spec.rb
187
190
  homepage: http://github.com/aq1018/active_model-better_errors
188
191
  licenses:
189
192
  - MIT
@@ -204,26 +207,28 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
207
  version: '0'
205
208
  requirements: []
206
209
  rubyforge_project:
207
- rubygems_version: 2.1.11
210
+ rubygems_version: 2.0.14
208
211
  signing_key:
209
212
  specification_version: 4
210
213
  summary: active_model-better_errors is a ActiveModel::Errors compatible library to
211
214
  help you customize the presentation of your error messages.
212
215
  test_files:
216
+ - spec/integration/integration_spec.rb
213
217
  - spec/spec_helper.rb
218
+ - spec/support/active_record.rb
214
219
  - spec/support/i18n_deprecation_silence.rb
215
220
  - spec/support/models.rb
216
221
  - spec/support/string_ext.rb
217
- - spec/unit/lib/active_model/better_errors/emulation_spec.rb
218
- - spec/unit/lib/active_model/better_errors/error_collection_spec.rb
219
- - spec/unit/lib/active_model/better_errors/error_message_set_spec.rb
220
- - spec/unit/lib/active_model/better_errors/error_message_spec.rb
221
- - spec/unit/lib/active_model/better_errors/errors_spec.rb
222
- - spec/unit/lib/active_model/better_errors/human_array_reporter_spec.rb
223
- - spec/unit/lib/active_model/better_errors/human_hash_reporter_spec.rb
224
- - spec/unit/lib/active_model/better_errors/human_message_formatter_spec.rb
225
- - spec/unit/lib/active_model/better_errors/human_message_reporter_spec.rb
226
- - spec/unit/lib/active_model/better_errors/machine_array_reporter_spec.rb
227
- - spec/unit/lib/active_model/better_errors/machine_hash_reporter_spec.rb
228
- - spec/unit/lib/active_model/better_errors_spec.rb
222
+ - spec/unit/active_model/better_errors/emulation_spec.rb
223
+ - spec/unit/active_model/better_errors/error_collection_spec.rb
224
+ - spec/unit/active_model/better_errors/error_message_set_spec.rb
225
+ - spec/unit/active_model/better_errors/error_message_spec.rb
226
+ - spec/unit/active_model/better_errors/errors_spec.rb
227
+ - spec/unit/active_model/better_errors/human_array_reporter_spec.rb
228
+ - spec/unit/active_model/better_errors/human_hash_reporter_spec.rb
229
+ - spec/unit/active_model/better_errors/human_message_formatter_spec.rb
230
+ - spec/unit/active_model/better_errors/human_message_reporter_spec.rb
231
+ - spec/unit/active_model/better_errors/machine_array_reporter_spec.rb
232
+ - spec/unit/active_model/better_errors/machine_hash_reporter_spec.rb
233
+ - spec/unit/active_model/better_errors_spec.rb
229
234
  has_rdoc: