active_brainz 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67d98d8ec1ac6e3ddd67e259058124aba66651c0fe6f9af1ecd8f6415ff74e15
|
4
|
+
data.tar.gz: d47f5ff93d6052e541e2d68d5bc7d213251c9477ac4700750b63d186ea1ec960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29057cb9e1b3c2314d4ab58a8dceb63ab02e6952f6539d4739d78e1ba8176049e3e885954c196d218316cbad568a61d44b54a51fbe6ff3e34defb55587468fb8
|
7
|
+
data.tar.gz: 65b1e4e8a09130520da1dc5ff20d8dfafdfb9ccbab0ec192ae30ca3348b4b6e718a5b6e122d4c01388004eccf10b7b65d9a581811c406027501010fee336ffdd
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ActiveBrainz
|
4
|
+
module HasBeginEndDate
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
attribute :begin_date_year, :integer
|
9
|
+
attribute :begin_date_month, :integer
|
10
|
+
attribute :begin_date_day, :integer
|
11
|
+
|
12
|
+
attribute :end_date_year, :integer
|
13
|
+
attribute :end_date_month, :integer
|
14
|
+
attribute :end_date_day, :integer
|
15
|
+
|
16
|
+
attribute :ended, :boolean
|
17
|
+
|
18
|
+
def begin_date
|
19
|
+
@begin_date ||= Date.new(*[begin_date_year, begin_date_month, begin_date_day].compact) if begin_date_year
|
20
|
+
end
|
21
|
+
|
22
|
+
def end_date
|
23
|
+
@end_date ||= Date.new(*[end_date_year, end_date_month, end_date_day].compact) if end_date_year
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ActiveBrainz
|
4
|
+
module HasParentChildren
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
has_many :children,
|
9
|
+
class_name: name.demodulize,
|
10
|
+
foreign_key: "parent"
|
11
|
+
|
12
|
+
belongs_to :parent,
|
13
|
+
class_name: name.demodulize,
|
14
|
+
foreign_key: "parent",
|
15
|
+
optional: true
|
16
|
+
|
17
|
+
attribute :child_order, :integer
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_brainz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Dejonckheere
|
@@ -316,6 +316,9 @@ files:
|
|
316
316
|
- README.md
|
317
317
|
- config/inflections.rb
|
318
318
|
- lib/active_brainz.rb
|
319
|
+
- lib/active_brainz/concerns/has_begin_end_date.rb
|
320
|
+
- lib/active_brainz/concerns/has_gid.rb
|
321
|
+
- lib/active_brainz/concerns/has_parent_children.rb
|
319
322
|
- lib/active_brainz/models/area/area.rb
|
320
323
|
- lib/active_brainz/models/area/area_type.rb
|
321
324
|
- lib/active_brainz/models/artist/artist.rb
|