Sha256: 4ea7d9da543f6e128a7b1b723574156fac50c734c6ca92d2d28a27e7354c391e

Contents?: true

Size: 374 Bytes

Versions: 52

Compression:

Stored size: 374 Bytes

Contents

def update_color
  colors = YAML.load(open('db/fixtures/enju_library/colors.yml').read)
  library_group = LibraryGroup.site_config
  colors.each do |line|
    l = line[1].select!{|k, v| %w(property code).include?(k)}
    color = Color.where(property: l["property"]).first
    unless color
      color = Color.create!(l)
      library_group.colors << color
    end
  end
end

Version data entries

52 entries across 50 versions & 2 rubygems

Version Path
enju_library-0.3.11 lib/tasks/color.rb
enju_library-0.3.10 lib/tasks/color.rb
enju_library-0.3.9 lib/tasks/color.rb
enju_library-0.3.8 lib/tasks/color.rb
enju_library-0.3.8.rc.2 lib/tasks/color.rb
enju_library-0.3.8.rc.1 lib/tasks/color.rb
enju_library-0.4.0.rc.1 lib/tasks/color.rb
enju_library-0.3.7 lib/tasks/color.rb
enju_library-0.3.6 lib/tasks/color.rb
enju_library-0.4.0.beta.4 lib/tasks/color.rb
enju_library-0.4.0.beta.3 lib/tasks/color.rb
enju_library-0.4.0.beta.2 lib/tasks/color.rb
enju_library-0.4.0.beta.1 lib/tasks/color.rb
enju_library-0.3.5 lib/tasks/color.rb
enju_library-0.3.4 lib/tasks/color.rb
enju_library-0.3.3 lib/tasks/color.rb
enju_library-0.3.2 lib/tasks/color.rb
enju_library-0.3.1 lib/tasks/color.rb
enju_library-0.3.0 lib/tasks/color.rb
enju_library-0.3.0.rc.1 lib/tasks/color.rb