activemodel 4.1.0.rc1 → 4.1.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activemodel might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/lib/active_model/gem_version.rb +15 -0
- data/lib/active_model/secure_password.rb +4 -4
- data/lib/active_model/validations/with.rb +2 -0
- data/lib/active_model/version.rb +4 -7
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30bfb82be27ab63acf80a28f3c612c9eb4de181b
|
4
|
+
data.tar.gz: d8f7d7e5b501c1d9b74c971713a0f8a6592008f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c841c99e1ea218b9620deec666fd045e12e3d1f962155b98ae148866cead28ad2575bc7d5726e1f94311b7b6b571afccc9b113817bb0639dc1fccb3b9ab37234
|
7
|
+
data.tar.gz: 584b8d84f79653b0b7284e29cfe801d5b54a9d0130040c7ce21cd985167e5623aa388a64939e58fee05be2cee434922e9e3c2971366d0f7e770f1a1dceaee081
|
data/README.rdoc
CHANGED
@@ -227,7 +227,7 @@ The latest version of Active Model can be installed with RubyGems:
|
|
227
227
|
|
228
228
|
Source code can be downloaded as part of the Rails project on GitHub
|
229
229
|
|
230
|
-
* https://github.com/rails/rails/tree/
|
230
|
+
* https://github.com/rails/rails/tree/4-1-stable/activemodel
|
231
231
|
|
232
232
|
|
233
233
|
== License
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ActiveModel
|
2
|
+
# Returns the version of the currently loaded ActiveModel as a <tt>Gem::Version</tt>
|
3
|
+
def self.gem_version
|
4
|
+
Gem::Version.new VERSION::STRING
|
5
|
+
end
|
6
|
+
|
7
|
+
module VERSION
|
8
|
+
MAJOR = 4
|
9
|
+
MINOR = 1
|
10
|
+
TINY = 0
|
11
|
+
PRE = "rc2"
|
12
|
+
|
13
|
+
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
14
|
+
end
|
15
|
+
end
|
@@ -20,9 +20,9 @@ module ActiveModel
|
|
20
20
|
# value to the password_confirmation attribute and the validation
|
21
21
|
# will not be triggered.
|
22
22
|
#
|
23
|
-
# You need to add bcrypt
|
23
|
+
# You need to add bcrypt (~> 3.1.7) to Gemfile to use #has_secure_password:
|
24
24
|
#
|
25
|
-
# gem 'bcrypt
|
25
|
+
# gem 'bcrypt', '~> 3.1.7'
|
26
26
|
#
|
27
27
|
# Example using Active Record (which automatically includes ActiveModel::SecurePassword):
|
28
28
|
#
|
@@ -42,13 +42,13 @@ module ActiveModel
|
|
42
42
|
# User.find_by(name: 'david').try(:authenticate, 'notright') # => false
|
43
43
|
# User.find_by(name: 'david').try(:authenticate, 'mUc3m00RsqyRe') # => user
|
44
44
|
def has_secure_password(options = {})
|
45
|
-
# Load bcrypt
|
45
|
+
# Load bcrypt gem only when has_secure_password is used.
|
46
46
|
# This is to avoid ActiveModel (and by extension the entire framework)
|
47
47
|
# being dependent on a binary library.
|
48
48
|
begin
|
49
49
|
require 'bcrypt'
|
50
50
|
rescue LoadError
|
51
|
-
$stderr.puts "You don't have bcrypt
|
51
|
+
$stderr.puts "You don't have bcrypt installed in your application. Please add it to your Gemfile and run bundle install"
|
52
52
|
raise
|
53
53
|
end
|
54
54
|
|
@@ -139,6 +139,8 @@ module ActiveModel
|
|
139
139
|
# class version of this method for more information.
|
140
140
|
def validates_with(*args, &block)
|
141
141
|
options = args.extract_options!
|
142
|
+
options[:class] = self.class
|
143
|
+
|
142
144
|
args.each do |klass|
|
143
145
|
validator = klass.new(options, &block)
|
144
146
|
validator.validate(self)
|
data/lib/active_model/version.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
|
+
require_relative 'gem_version'
|
2
|
+
|
1
3
|
module ActiveModel
|
2
|
-
# Returns the version of the currently loaded ActiveModel as a Gem::Version
|
4
|
+
# Returns the version of the currently loaded ActiveModel as a <tt>Gem::Version</tt>
|
3
5
|
def self.version
|
4
|
-
|
5
|
-
end
|
6
|
-
|
7
|
-
module VERSION #:nodoc:
|
8
|
-
MAJOR, MINOR, TINY, PRE = ActiveModel.version.segments
|
9
|
-
STRING = ActiveModel.version.to_s
|
6
|
+
gem_version
|
10
7
|
end
|
11
8
|
end
|
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: 4.1.0.
|
4
|
+
version: 4.1.0.rc2
|
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: 2014-
|
11
|
+
date: 2014-03-25 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: 4.1.0.
|
19
|
+
version: 4.1.0.rc2
|
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: 4.1.0.
|
26
|
+
version: 4.1.0.rc2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/active_model/dirty.rb
|
57
57
|
- lib/active_model/errors.rb
|
58
58
|
- lib/active_model/forbidden_attributes_protection.rb
|
59
|
+
- lib/active_model/gem_version.rb
|
59
60
|
- lib/active_model/lint.rb
|
60
61
|
- lib/active_model/locale/en.yml
|
61
62
|
- lib/active_model/model.rb
|