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.0.beta.2 lib/tasks/color.rb
enju_library-0.2.5 lib/tasks/color.rb
enju_library-0.2.4 lib/tasks/color.rb
enju_library-0.2.3 lib/tasks/color.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/bundler/gems/enju_library-d36f415e177e/lib/tasks/color.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.2/lib/tasks/color.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.1/lib/tasks/color.rb
enju_library-0.2.2 lib/tasks/color.rb
enju_library-0.2.1 lib/tasks/color.rb
enju_library-0.2.0 lib/tasks/color.rb
enju_library-0.2.0.beta.10 lib/tasks/color.rb
enju_library-0.2.0.beta.9 lib/tasks/color.rb
enju_library-0.2.0.beta.8 lib/tasks/color.rb
enju_library-0.2.0.beta.7 lib/tasks/color.rb
enju_library-0.2.0.beta.6 lib/tasks/color.rb
enju_library-0.2.0.beta.5 lib/tasks/color.rb
enju_library-0.2.0.beta.4 lib/tasks/color.rb
enju_library-0.2.0.beta.3 lib/tasks/color.rb
enju_library-0.2.0.beta.2 lib/tasks/color.rb
enju_library-0.2.0.beta.1 lib/tasks/color.rb