oh that makes total sense, was just surprised that it still works :)



On Fri, Apr 25, 2014 at 4:12 PM, tobyk100 <notifications@github.com> wrote:

> In app/models/script.rb:
>
> > +  def self.add_scripts(options, data, custom=false)
> > +    options.keys.each { |k|
> > +      options[k] = Video.find_by_key(options[k]) if k == 'wrapup_video'
> > +    }
> > +    game_map = Game.all.index_by(&:name)
> > +    concept_map = Concept.all.index_by(&:name)
> > +
> > +    # Create Script entry
> > +    script = Script.where(options).first_or_create
> > +    old_script_levels = ScriptLevel.where(script: script).to_a # tracks which levels are no longer included in script.
> > +    game_index = Hash.new(0)
> > +
> > +    data.each_with_index do |row, index|
> > +      # Reference one Level per element
> > +      if custom
> > +        level = get_level_by_name(row['name']).first
>
> Well, when I wrote get_level_by_name the def and the call were both in
> seed.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/code-dot-org/dashboard/pull/520/files#r12020119>
> .
>