Top Level Namespace
Defined Under Namespace
Modules: EnjuLibrary, ShelvesHelper Classes: Accept, AcceptsController, Basket, BasketsController, Bookstore, BookstoresController, BudgetType, BudgetTypesController, Color, LibrariesController, Library, LibraryGroup, LibraryGroupsController, RequestStatusType, RequestStatusTypesController, RequestType, RequestTypesController, SearchEngine, SearchEnginesController, Shelf, ShelvesController, Subscribe, SubscribesController, Subscription, SubscriptionsController, Withdraw, WithdrawsController
Instance Method Summary collapse
Instance Method Details
#update_color ⇒ Object
1 2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/tasks/color.rb', line 1 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 |