Module: OutroRails::VoicingSeedEntry
- Defined in:
- lib/outro_rails/generators/voicing_seed_entry.rb
Overview
Whether a voicing seed entry (a hash loaded from db/seeds/chord_voicings/*.yml) is complete enough to become a ChordVoicing record. Stub files intentionally ship with blank fields for a human to fill in by hand - see VoicingStubGenerator - and those blanks must not reach the database as nil columns.
Only guitar entries can be incomplete this way: piano stubs are always fully computed.
Class Method Summary collapse
-
.complete?(entry) ⇒ Boolean
True when the entry is safe to load.
Class Method Details
.complete?(entry) ⇒ Boolean
True when the entry is safe to load. Non-guitar instruments pass straight through; guitar entries are checked for filled-in diagram data.
17 18 19 20 21 |
# File 'lib/outro_rails/generators/voicing_seed_entry.rb', line 17 def complete?(entry) return true unless entry["instrument"].to_s == "guitar" guitar_display_data_complete?(entry["display_data"]) end |