Guest User

Untitled

a guest
Apr 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class Bookable < ActiveRecord::Base
  2.  
  3. attr_setter :properties
  4.  
  5. acts_as_line
  6.  
  7. def properties
  8. @properties ||= []
  9. end
  10. end
  11.  
  12. @bookables.each do |bookable|
  13. @properties.each {|property|
  14. bookable.properties << property unless property.bookings.touching(bookable).any?
  15. }
  16. end
Add Comment
Please, Sign In to add comment