active_musicbrainz 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +1 -1
- data/Rakefile +0 -0
- data/active_musicbrainz.gemspec +0 -0
- data/lib/active_musicbrainz.rb +0 -0
- data/lib/active_musicbrainz/config.rb +0 -0
- data/lib/active_musicbrainz/models/base.rb +6 -0
- data/lib/active_musicbrainz/models/factory.rb +0 -0
- data/lib/active_musicbrainz/models/model.rb +5 -2
- data/lib/active_musicbrainz/version.rb +1 -1
- data/test/config.yml +0 -0
- data/test/models/model_test.rb +0 -0
- data/test/test_helper.rb +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b3ca87ca2ab1f3392e0fca412be336a9f689b72
|
4
|
+
data.tar.gz: a73018045df3d959950a0516314d8dd96d535122
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eaec8840c5722aa4880e1aaf501857df624ee0dba67a26e148f2c8517d05577a4c8fbeb9aeb923c336283c917c46bc339e0b2e88c7e94ff85855b7c869a0db6
|
7
|
+
data.tar.gz: 80b7549092a91f085ce4103dcf34c62f36b8c7e4deb277962b8aa5642d762f00c1307e5b850284af77424d4ff029332c5df318643ba7499123bac9da2bda0eb0
|
data/.gitignore
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ If you are inside a rails project you could put the code above in **config/initi
|
|
33
33
|
Now under the ActiveMusicbrainz::Model module, you have one model for each MusicBrainz table.
|
34
34
|
Here some examples:
|
35
35
|
|
36
|
-
artist = ActiveMusicbrainz::Model::Artist.
|
36
|
+
artist = ActiveMusicbrainz::Model::Artist.by_gid '9a709693-b4f8-4da9-8cc1-038c911a61be'
|
37
37
|
=> #<ActiveMusicbrainz::Model::Artist id: 24146, gid: "9a709693-b4f8-4da9-8cc1-038c911a61be", name: 143497, sort_name: 143497, begin_date_year: 1976, begin_date_month: 3, begin_date_day: 30, end_date_year: nil, end_date_month: nil, end_date_day: nil, type: 1, area: 221, gender: 1, comment: "UK electro artist Simon Green", edits_pending: 0, last_updated: "2013-05-13 11:00:09", ended: false, begin_area: nil, end_area: nil>
|
38
38
|
|
39
39
|
artist.name
|
data/Rakefile
CHANGED
File without changes
|
data/active_musicbrainz.gemspec
CHANGED
File without changes
|
data/lib/active_musicbrainz.rb
CHANGED
File without changes
|
File without changes
|
@@ -17,6 +17,12 @@ module ActiveMusicbrainz
|
|
17
17
|
has_many :artist_credit_names, through: :artist_credit
|
18
18
|
has_many :artists, through: :artist_credit_names
|
19
19
|
end
|
20
|
+
|
21
|
+
def has_gid
|
22
|
+
define_singleton_method :by_gid do |gid|
|
23
|
+
find_by gid: gid
|
24
|
+
end
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
22
28
|
end
|
File without changes
|
@@ -22,6 +22,7 @@ module ActiveMusicbrainz
|
|
22
22
|
has_name :artist_name
|
23
23
|
has_many :l_artist_urls, foreign_key: :entity0
|
24
24
|
has_many :urls, through: :l_artist_urls
|
25
|
+
has_gid
|
25
26
|
end
|
26
27
|
|
27
28
|
model :l_artist_url do
|
@@ -65,6 +66,7 @@ module ActiveMusicbrainz
|
|
65
66
|
has_one :release, through: :medium
|
66
67
|
has_name :track_name
|
67
68
|
has_artist_credits
|
69
|
+
has_gid
|
68
70
|
end
|
69
71
|
|
70
72
|
model :release_group_secondary_type do
|
@@ -85,8 +87,8 @@ module ActiveMusicbrainz
|
|
85
87
|
belongs_to :type, class_name: 'ReleaseGroupPrimaryType', foreign_key: :type
|
86
88
|
has_many :release_group_secondary_type_joins, foreign_key: :release_group
|
87
89
|
has_many :secondary_types, through: :release_group_secondary_type_joins, source: :type
|
88
|
-
|
89
90
|
has_artist_credits
|
91
|
+
has_gid
|
90
92
|
end
|
91
93
|
|
92
94
|
model :release do
|
@@ -99,8 +101,8 @@ module ActiveMusicbrainz
|
|
99
101
|
belongs_to :status, class_name: 'ReleaseStatus', foreign_key: :status
|
100
102
|
belongs_to :packaging, class_name: 'ReleasePackaging', foreign_key: :packaging
|
101
103
|
belongs_to :release_country, foreign_key: :id, primary_key: :release
|
102
|
-
|
103
104
|
has_artist_credits
|
105
|
+
has_gid
|
104
106
|
end
|
105
107
|
|
106
108
|
model :medium do
|
@@ -120,6 +122,7 @@ module ActiveMusicbrainz
|
|
120
122
|
has_many :mediums, through: :tracks
|
121
123
|
has_name :track_name
|
122
124
|
has_artist_credits
|
125
|
+
has_gid
|
123
126
|
end
|
124
127
|
end
|
125
128
|
end
|
data/test/config.yml
CHANGED
File without changes
|
data/test/models/model_test.rb
CHANGED
File without changes
|
data/test/test_helper.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_musicbrainz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Franz
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.0.
|
97
|
+
rubygems_version: 2.0.6
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: ActiveRecord models the MusicBrainz database
|