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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b12b6e3b8a195b5dcf1a0782ebb7c468925b377
4
- data.tar.gz: d0802b02f15674a0053d0f3902e95ea11ea43e35
3
+ metadata.gz: 4b3ca87ca2ab1f3392e0fca412be336a9f689b72
4
+ data.tar.gz: a73018045df3d959950a0516314d8dd96d535122
5
5
  SHA512:
6
- metadata.gz: f73e18e05a2fcaba9ef766b2fb2064fd92a1b63f24d87c611b18a891035a7a0c97929e4ff03e94c8b6de16ae4cd8319ec45b524b15bfeef1a2765d476e04d59c
7
- data.tar.gz: fa9b21502a568d42acf790bca205caa0d6c03c0db9c3deb16c8d59a499948ca95b9875257e53e4ba2648aea5af99c842f8ee6503721602267934bc8468dc9cbd
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.where(gid: '9a709693-b4f8-4da9-8cc1-038c911a61be').first
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
File without changes
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
@@ -1,3 +1,3 @@
1
1
  module ActiveMusicbrainz
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.0"
3
3
  end
data/test/config.yml CHANGED
File without changes
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.1.6
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.0
97
+ rubygems_version: 2.0.6
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: ActiveRecord models the MusicBrainz database