attribute-defaults 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/attribute_defaults.rb +4 -7
  3. metadata +36 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 829a2fbfba5c83c3fc55fec964f36217b8b097c9
4
- data.tar.gz: 77d1a01e2bf364b3dc1ece8c0a896217a051feed
2
+ SHA256:
3
+ metadata.gz: ca26a4bb71d7a6dad922776645c493a4f2d58cc03bb291feea88fcb0261a4733
4
+ data.tar.gz: 3b8d8b4f8d65d70b6af9d57a25c789c56161c7bb218814ee418d97076a803f49
5
5
  SHA512:
6
- metadata.gz: 210c073e8e58439cca6cee8ce424235326dd513fca5c2b3968f02a84f6256119ab1fd45c238df79caac313ac9433564884ecdb0a322c8df96e01fbedb872694c
7
- data.tar.gz: e6ac571755c218c86ce5289e030d2d366035d9818071f928b52ee4b216efd5e02347c7cd10ef3767ae165d0a8d67c88b5b94753b76f80bf3b183c873897ca4b6
6
+ metadata.gz: a5f998d1fc6475947b94ccd778afe5e643686e2c0ee1a3dfb051add7975b0d0c34b2d35c60be8c1ac57a5b595ccd8c35765566857daf3fe6dbd1ef71caf0cb54
7
+ data.tar.gz: 767367fc27c227f774b61272081f96eb39ae62cbaa630bb6636f1eeef8849f1c652558b6df68e8c1c7343fedb62b3c8f3198257413203086096c7282b5511294
@@ -6,7 +6,6 @@ module ActiveRecord
6
6
  extend ActiveSupport::Concern
7
7
 
8
8
  module ClassMethods
9
-
10
9
  # Set defaults. Examples:
11
10
  # attr_default :age, 12
12
11
  # attr_default :description, '(none)'
@@ -41,20 +40,18 @@ module ActiveRecord
41
40
  end
42
41
 
43
42
  # Default mass-assignment. Examples:
44
- # attr_defaults description: '(none)', age: 12
45
- # attr_defaults description: '(none)', age: ->r { Time.zone.year - r.dob.year }
46
- # attr_defaults description: '(none)', age: { default: 12, persisted: false }
43
+ # attr_defaults description: '(none)', age: 12
44
+ # attr_defaults description: '(none)', age: ->r { Time.zone.year - r.dob.year }
45
+ # attr_defaults description: '(none)', age: { default: 12, persisted: false }
47
46
  def attr_defaults(pairs)
48
47
  pairs.each do |pair|
49
- attr_default *pair
48
+ attr_default(*pair)
50
49
  end
51
50
  end
52
-
53
51
  end
54
52
  end
55
53
 
56
54
  class Base
57
55
  include AttributesWithDefaults
58
56
  end
59
-
60
57
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attribute-defaults
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-08 00:00:00.000000000 Z
11
+ date: 2020-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 5.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 6.0.0
22
+ version: 7.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 5.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 6.0.0
32
+ version: 7.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rake
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -45,7 +45,7 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: sqlite3
48
+ name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
@@ -59,7 +59,35 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: rspec
62
+ name: rubocop
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rubocop-performance
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: sqlite3
63
91
  requirement: !ruby/object:Gem::Requirement
64
92
  requirements:
65
93
  - - ">="
@@ -93,15 +121,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
121
  requirements:
94
122
  - - ">="
95
123
  - !ruby/object:Gem::Version
96
- version: 2.2.0
124
+ version: 2.5.0
97
125
  required_rubygems_version: !ruby/object:Gem::Requirement
98
126
  requirements:
99
127
  - - ">="
100
128
  - !ruby/object:Gem::Version
101
129
  version: '0'
102
130
  requirements: []
103
- rubyforge_project:
104
- rubygems_version: 2.6.8
131
+ rubygems_version: 3.1.2
105
132
  signing_key:
106
133
  specification_version: 4
107
134
  summary: Specify default values for ActiveRecord attributes