Created
October 8, 2012 17:42
-
-
Save bricker/3853833 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Audio < ActiveRecord::Base | |
def self.sync! | |
[Audio::ProgramAudio, Audio::DirectAudio, Audio::EncoAudio].each do |klass| | |
klass.sync! | |
end | |
end | |
class EncoAudio < Audio | |
def self.sync! | |
sync_awaiting_audio_if_file_exists! | |
end | |
end | |
class ProgramAudio < Audio | |
def self.sync! | |
# do other stuff | |
end | |
end | |
class DirectAudio < Audio | |
def self.sync! | |
sync_awaiting_audio_if_file_exists! | |
end | |
end | |
class UploadedAudio < Audio | |
# no sync method | |
end | |
class << self | |
private | |
def sync_awaiting_audio_if_file_exists! | |
# check if file exists and set audio | |
end | |
end | |
# | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment