* get activeadmin working for JamTracks after onboarding enhancements were added

This commit is contained in:
Seth Call 2015-08-09 13:47:49 -05:00
parent 557e19e5e7
commit af355ec096
3 changed files with 14 additions and 4 deletions

View File

@ -24,11 +24,21 @@ ActiveAdmin.register JamRuby::JamTrack, :as => 'JamTracks' do
column :original_artist
column :name
column :onboarding_flags do |jam_track| jam_track.onboard_warnings end
column :onboarding_exceptions do |jam_track|
if jam_track.onboarding_exceptions
exceptions = JSON.parse(jam_track.onboarding_exceptions)
exceptions.keys.join(',')
else
''
end
end
column :status
column :master_track do |jam_track| jam_track.master_track.nil? ? 'None' : (link_to "Download", jam_track.master_track.url_by_sample_rate(44)) end
column :licensor
column :genre
column :genres do |jam_track|
jam_track.genres.map(&:description).join(',')
end
column :price
column :reproduction_royalty
column :public_performance_royalty

View File

@ -12,7 +12,7 @@
= f.input :songwriter, :input_html => { :rows=>1, :maxlength=>1000 }
= f.input :publisher, :input_html => { :rows=>1, :maxlength=>1000 }
= f.input :licensor, collection: JamRuby::JamTrackLicensor.all, include_blank: true
= f.input :genre, collection: JamRuby::Genre.all, include_blank: false
= f.input :genres
= f.input :duration, hint: 'this should rarely need editing because it comes from the import process'
= f.input :sales_region, collection: JamRuby::JamTrack::SALES_REGION, include_blank: false
= f.input :price, :required => true, :input_html => {type: 'numeric'}

View File

@ -17,7 +17,7 @@ module JamRuby
:original_artist, :songwriter, :publisher, :licensor, :licensor_id, :pro, :genres_jam_tracks_attributes, :sales_region, :price,
:reproduction_royalty, :public_performance_royalty, :reproduction_royalty_amount,
:licensor_royalty_amount, :pro_royalty_amount, :plan_code, :initial_play_silence, :jam_track_tracks_attributes,
:jam_track_tap_ins_attributes, :version, :jmep_json, :jmep_text, :pro_ascap, :pro_bmi, :pro_sesac, :duration, as: :admin
:jam_track_tap_ins_attributes, :genre_ids, :version, :jmep_json, :jmep_text, :pro_ascap, :pro_bmi, :pro_sesac, :duration, as: :admin
validates :name, presence: true, uniqueness: true, length: {maximum: 200}
validates :plan_code, presence: true, uniqueness: true, length: {maximum: 50 }