| Module | ModeSequence |
| In: |
app/models/mode_sequence.rb
|
Extends the Scale.modes association by allowing indexed access to modes. Whn using it in this manner, key context is passed along.
# File app/models/mode_sequence.rb, line 5
5: def [](value)
6: mode_object = self.find(:first, :conditions => ["name = ? OR mode = ?", value, value])
7: return nil if mode_object.nil?
8:
9: # Pass Along Key Information
10: mode_object.key = proxy_owner.key if proxy_owner.respond_to?(:key) and !proxy_owner.key.nil?
11: mode_object
12: end