* VRFS-2625 - adding bpm and tap_in_count to tap in row, and remove tap_in from jamtracks
This commit is contained in:
parent
e28db48e94
commit
b5c446dd04
|
|
@ -26,8 +26,6 @@ ActiveAdmin.register JamRuby::JamTrack, :as => 'JamTracks' do
|
|||
column :id
|
||||
column :name
|
||||
column :description
|
||||
column :bpm
|
||||
column :tap_in_count
|
||||
column :initial_play_silence
|
||||
column :time_signature
|
||||
column :status
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@
|
|||
| JamTrack should only be made available (to end users) if all its sub-component are in place:
|
||||
= f.input :available, as: :boolean
|
||||
= f.input :description, :input_html => { :rows=>5, :maxlength=>1000 }
|
||||
= f.input :bpm
|
||||
= f.input :tap_in_count
|
||||
= f.input :initial_play_silence, :label => 'Initial Play Silence (seconds)'
|
||||
= f.input :time_signature, collection: JamRuby::JamTrack::TIME_SIGNATURES, include_blank: false
|
||||
= f.input :status, collection: JamRuby::JamTrack::STATUS, include_blank: false
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
= f.inputs name: 'Tap In fields' do
|
||||
|
||||
ol.nested-fields
|
||||
= f.input :bpm, :label => 'BPM', :required => true
|
||||
= f.input :tap_in_count, :label => 'Tap In Count', :required => true, :hint => 'number of taps in leading up to the Offset Time to play'
|
||||
= f.input :offset_time_raw, :label => 'Offset Time', :hint => 'MM:SS:MLS', :required => true, :as => :string
|
||||
|
||||
- if f.object.new_record?
|
||||
|
|
|
|||
|
|
@ -239,3 +239,4 @@ private_key_in_jam_track_rights.sql
|
|||
jam_track_tap_in.sql
|
||||
jam_track_available.sql
|
||||
active_jam_track.sql
|
||||
bpms_on_tap_in.sql
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE jam_track_tap_ins ADD COLUMN bpm DECIMAL NOT NULL;
|
||||
ALTER TABLE jam_track_tap_ins ADD COLUMN tap_in_count INTEGER NOT NULL DEFAULT 0;
|
||||
ALTER TABLE jam_tracks DROP COLUMN tap_in_count;
|
||||
|
|
@ -15,7 +15,7 @@ module JamRuby
|
|||
attr_accessible :name, :description, :bpm, :time_signature, :status, :recording_type,
|
||||
:original_artist, :songwriter, :publisher, :licensor, :licensor_id, :pro, :genre, :genre_id, :sales_region, :price,
|
||||
:reproduction_royalty, :public_performance_royalty, :reproduction_royalty_amount,
|
||||
:licensor_royalty_amount, :pro_royalty_amount, :plan_code, :tap_in_count, :initial_play_silence, :jam_track_tracks_attributes,
|
||||
:licensor_royalty_amount, :pro_royalty_amount, :plan_code, :initial_play_silence, :jam_track_tracks_attributes,
|
||||
:jam_track_tap_ins_attributes, :available, as: :admin
|
||||
|
||||
validates :name, presence: true, uniqueness: true, length: {maximum: 200}
|
||||
|
|
@ -30,7 +30,6 @@ module JamRuby
|
|||
validates :pro, inclusion: {in: [nil] + PRO}
|
||||
validates :sales_region, inclusion: {in: [nil] + SALES_REGION}
|
||||
validates_format_of :price, with: /^\d+\.*\d{0,2}$/
|
||||
validates :tap_in_count, presence: true, numericality: {only_integer: true}
|
||||
validates :initial_play_silence, numericality: true, :allow_nil => true
|
||||
|
||||
validates :reproduction_royalty, inclusion: {in: [nil, true, false]}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
module JamRuby
|
||||
class JamTrackTapIn < ActiveRecord::Base
|
||||
|
||||
attr_accessible :jam_track_id, :offset_time, :offset_time_raw, as: :admin
|
||||
attr_accessible :jam_track_id, :offset_time, :offset_time_raw, :bpm, :tap_in_count, as: :admin
|
||||
|
||||
validates :offset_time, presence: true, numericality: {only_integer: true}, length: {in: 1..1000}
|
||||
validates :jam_track, presence: true
|
||||
validates :bpm, presence: true
|
||||
validates_format_of :bpm, with: /^\d+\.*\d{0,1}$/
|
||||
validates :tap_in_count, presence: true, numericality: {only_integer: true}
|
||||
|
||||
belongs_to :jam_track, class_name: "JamRuby::JamTrack"
|
||||
|
||||
|
|
|
|||
|
|
@ -743,5 +743,7 @@ FactoryGirl.define do
|
|||
factory :jam_track_tap_in, :class => JamRuby::JamTrackTapIn do
|
||||
association :jam_track, factory: :jam_track
|
||||
offset_time 0
|
||||
bpm 120
|
||||
tap_in_count 3
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -70,14 +70,14 @@ else
|
|||
|
||||
# only show currently open jam track info if the current user is in the session
|
||||
child({:jam_track => :jam_track}, :if => lambda { |music_session| music_session.users.exists?(current_user) }) {
|
||||
attributes :id, :name, :description, :bpm, :initial_play_silence, :tap_in_count
|
||||
attributes :id, :name, :description, :initial_play_silence
|
||||
|
||||
child(:jam_track_tracks => :tracks) {
|
||||
attributes :id, :part, :instrument
|
||||
}
|
||||
|
||||
child(:jam_track_tap_ins => :tap_ins) {
|
||||
attributes :offset_time
|
||||
attributes :offset_time, :bpm, :tap_in_count
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -709,7 +709,6 @@ FactoryGirl.define do
|
|||
licensor_royalty_amount 0.999
|
||||
pro_royalty_amount 0.999
|
||||
plan_code 'jamtrack-acdc-backinblack'
|
||||
tap_in_count 0
|
||||
ignore do
|
||||
make_track true
|
||||
end
|
||||
|
|
@ -739,5 +738,7 @@ FactoryGirl.define do
|
|||
factory :jam_track_tap_in, :class => JamRuby::JamTrackTapIn do
|
||||
association :jam_track, factory: :jam_track
|
||||
offset_time 0
|
||||
bpm 120
|
||||
tap_in_count 3
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue