activemodel 5.0.0.beta2 → 5.0.0.beta3

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: f2bd8bdd92a793edb27730346d5edf608cc258c0
4
- data.tar.gz: 4357a0da4faeaa914826946b48dff00ef539a813
3
+ metadata.gz: c283ac88f7c8c09878346cd9ac5317371c141bb6
4
+ data.tar.gz: 9141a1af7e5100d957d9192e0e2beae4306e2c68
5
5
  SHA512:
6
- metadata.gz: 54364ff9de9bdb05ab90af956ce092d4c06b6e48489c63e79d8c1c11b88592f55aa1a17385318e414feccf97f43904fb36d81cbd37b2bda8d9c0be31fb79fb38
7
- data.tar.gz: e603b0b527d2e59451562b64c7e3fa0477d16aae249d2ecdfdd54304c5b07a1ae66f7ef0c72680d02bdcac1a3decbbdc83e036e4daa00b9be7c473fd4d3e866f
6
+ metadata.gz: 069aec401e7854c4d2e3e578ed6d4226f07d9411049b262ef1d5a81ab639c9d34aff29e22af5676a0ec065b98a4ef9e0cf5b31c2d228aff833d70465de61cf21
7
+ data.tar.gz: a4e7860c438a2ac4933cdada88fe0e84c0154870ec7fbd88f60d6b53f1d4c3e1824ac494f7f54871c9bd7b72f299890b9c2c5efdbf1f937e68297ddd0c9ec26b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## Rails 5.0.0.beta3 (February 24, 2016) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 5.0.0.beta2 (February 01, 2016) ##
2
7
 
3
8
  * No changes.
@@ -160,6 +160,15 @@ module ActiveModel
160
160
  #
161
161
  # person.errors[:name] # => ["cannot be nil"]
162
162
  # person.errors['name'] # => ["cannot be nil"]
163
+ #
164
+ # Note that, if you try to get errors of an attribute which has
165
+ # no errors associated with it, this method will instantiate
166
+ # an empty error list for it and +keys+ will return an array
167
+ # of error keys which includes this attribute.
168
+ #
169
+ # person.errors.keys # => []
170
+ # person.errors[:name] # => []
171
+ # person.errors.keys # => [:name]
163
172
  def [](attribute)
164
173
  messages[attribute.to_sym]
165
174
  end
@@ -318,7 +327,7 @@ module ActiveModel
318
327
  # # => {:base=>[{error: :name_or_email_blank}]}
319
328
  def add(attribute, message = :invalid, options = {})
320
329
  message = message.call if message.respond_to?(:call)
321
- detail = normalize_detail(attribute, message, options)
330
+ detail = normalize_detail(message, options)
322
331
  message = normalize_message(attribute, message, options)
323
332
  if exception = options[:strict]
324
333
  exception = ActiveModel::StrictValidationFailed if exception == true
@@ -493,7 +502,7 @@ module ActiveModel
493
502
  end
494
503
  end
495
504
 
496
- def normalize_detail(attribute, message, options)
505
+ def normalize_detail(message, options)
497
506
  { error: message }.merge(options.except(*CALLBACKS_OPTIONS + MESSAGE_OPTIONS))
498
507
  end
499
508
  end
@@ -8,7 +8,7 @@ module ActiveModel
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
10
  TINY = 0
11
- PRE = "beta2"
11
+ PRE = "beta3"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -163,10 +163,6 @@ module ActiveModel
163
163
  # +ArgumentError+ when invalid options are supplied.
164
164
  def check_validity!
165
165
  end
166
-
167
- def should_validate?(record) # :nodoc:
168
- !record.persisted? || record.changed? || record.marked_for_destruction?
169
- end
170
166
  end
171
167
 
172
168
  # +BlockValidator+ is a special +EachValidator+ which receives a block on initialization
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.beta2
4
+ version: 5.0.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-01 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0.beta2
19
+ version: 5.0.0.beta3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0.beta2
26
+ version: 5.0.0.beta3
27
27
  description: A toolkit for building modeling frameworks like Active Record. Rich support
28
28
  for attributes, callbacks, validations, serialization, internationalization, and
29
29
  testing.
@@ -113,9 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: 1.3.1
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.5.2
116
+ rubygems_version: 2.5.1
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: A toolkit for building modeling frameworks (part of Rails).
120
120
  test_files: []
121
- has_rdoc: