nostalgic 0.5.2 → 0.6.0

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
  SHA256:
3
- metadata.gz: a4418d5ac68107e4235b127b04376c9102fdf9bd667b4c6aff7fdc9932ea685f
4
- data.tar.gz: 40e667462f9bb333254b04df8383affff622e7ae8d9e3821f3ad989c78adf22c
3
+ metadata.gz: f714bb70f485db22d0910b1529315a6acd2f0d9db84f2835efaada57a32ca37c
4
+ data.tar.gz: 74f4bc356fe080d08125998b1eb4c6f1f5f7819674f5270c06d0cb5ba787ec57
5
5
  SHA512:
6
- metadata.gz: 3480f68ac795d8ed81cb8dfd6f5b9db21f3c289f835a428ebcec45a1163be670244f7fe9f5d5434bd4c7f7b36fc04450c5b83f8065187d86261628d6ca400fe8
7
- data.tar.gz: bc2c3809fc452b87adfa1ac4ad54244f90b9549f93fc3e55c3a240c606b3cb8b617c302e143ae45e3f394bdd7087ae264dde1680be3f538a2fe71888ba2a463e
6
+ metadata.gz: a7f49d3fba6fffeec8248adf4323d47f170121431974a61b3c674facf8ad7187baca20f34acc52d88d9c2359c6fb7fb8439942347faa43e1cf301cd529e6236a
7
+ data.tar.gz: 0456f778b53c9c7be2166b96b9488f8fcd4de035e7fad95c4e54645f99899de9b78c60dcee90531b4cb4167d65f2fcc55386f396288246778096ed66c204e955
@@ -68,46 +68,25 @@ module Nostalgic
68
68
  end
69
69
  end
70
70
 
71
- if Rails::VERSION::MAJOR == 5 and Rails::VERSION::MINOR >= 2
72
- def belongs_to(name, scope = nil, **options)
73
- super(name, scope, options.except(:nostalgic))
74
-
75
- if options.fetch(:nostalgic, false)
76
- foreign_key = options.fetch(:foreign_key, "#{name}_id")
77
- nostalgic_attr foreign_key
78
-
79
- class_eval <<-METHODS, __FILE__, __LINE__ + 1
80
- def #{name}_on(date)
81
- return self.#{name} unless date.present?
82
-
83
- '#{name}'.classify.constantize.find_by_id(#{foreign_key}_on(date))
84
- end
85
-
86
- alias_method :#{name}_at, :#{name}_on
87
- METHODS
88
- end
89
- end
90
- else
91
- def belongs_to(name, scope = nil, options = {})
92
- scope ||= {}
93
- super(name, scope.except(:nostalgic), options)
94
-
95
- if scope.fetch(:nostalgic, false)
96
- foreign_key = options.fetch(:foreign_key, "#{name}_id")
97
- nostalgic_attr foreign_key
98
-
99
- class_eval <<-METHODS, __FILE__, __LINE__ + 1
100
- def #{name}_on(date)
101
- return self.#{name} unless date.present?
102
-
103
- '#{name}'.classify.constantize.find_by_id(#{foreign_key}_on(date))
104
- end
105
-
106
- alias_method :#{name}_at, :#{name}_on
107
- METHODS
108
- end
71
+ def belongs_to(name, scope = nil, **options)
72
+ super(name, scope, **options.except(:nostalgic))
73
+
74
+ if options.fetch(:nostalgic, false)
75
+ foreign_key = options.fetch(:foreign_key, "#{name}_id")
76
+ nostalgic_attr foreign_key
77
+
78
+ class_eval <<-METHODS, __FILE__, __LINE__ + 1
79
+ def #{name}_on(date)
80
+ return self.#{name} unless date.present?
81
+
82
+ '#{name}'.classify.constantize.find_by_id(#{foreign_key}_on(date))
83
+ end
84
+
85
+ alias_method :#{name}_at, :#{name}_on
86
+ METHODS
109
87
  end
110
88
  end
89
+
111
90
  end
112
91
  end
113
92
  end
@@ -1,3 +1,3 @@
1
1
  module Nostalgic
2
- VERSION = '0.5.2'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nostalgic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-18 00:00:00.000000000 Z
11
+ date: 2022-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '5.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6'
22
+ version: '7'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.2'
29
+ version: '5.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6'
32
+ version: '7'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -135,14 +135,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 2.5.0
138
+ version: 2.7.0
139
139
  required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubygems_version: 3.0.3
145
+ rubygems_version: 3.3.10
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: column versioning utility