lib/refinerycms-page-images.rb in refinerycms-page-images-0.9.3 vs lib/refinerycms-page-images.rb in refinerycms-page-images-0.9.4
- old
+ new
@@ -7,11 +7,12 @@
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
end
config.to_prepare do
Page.module_eval do
-
- has_and_belongs_to_many :images
+
+ has_many :image_pages
+ has_many :images, :through => :image_pages
accepts_nested_attributes_for :images, :allow_destroy => false
def images_attributes=(data)
self.images.clear
self.images += (0..(data.length-1)).collect { |i|