Sha256: 1090b1f64b3838987293316dfebfb9c93da025e1acb07da95e304c9dbe33c177

Contents?: true

Size: 332 Bytes

Versions: 25

Compression:

Stored size: 332 Bytes

Contents

class GalleryPhotos
  attr_reader :parent
  attr_reader :params

  def initialize(parent, params)
    @parent = parent
    @params = params
  end

  def sort_gallery_photos_for_parent
    params[:gallery_photos].each_with_index do |id, index|
      parent.gallery_photos.find(id).update_attributes(order: index+1)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
biola_wcms_components-0.15.1 lib/components/gallery_photos.rb
biola_wcms_components-0.15.0 lib/components/gallery_photos.rb
biola_wcms_components-0.14.0 lib/components/gallery_photos.rb
biola_wcms_components-0.13.0 lib/components/gallery_photos.rb
biola_wcms_components-0.12.0 lib/components/gallery_photos.rb