types = ['studio', 'high-rise', 'loft', 'duplex', 'micro']

types.each { |type| Type.create(name: type) }

5.times do |n|
  3.times do
    Apartment.create(
      address: Faker::Address.street_address,
      rent: "#{Faker::Number.number(digits: 4)}",
      reviews: Faker::Number.decimal(l_digits: 1, r_digits: 1),
      amenities: 'wifi, parking',
      deposit: "#{Faker::Number.number(digits: 4)}",
      sq_ft: "#{Faker::Number.number(digits: 3)}",
      lease_length: "#{Faker::Number.number(digits: 2)} months",
      type_id: n+1
    )
  end
end

apartment_images = ["https://media.gettyimages.com/photos/large-multicondos-building-blocks-with-bicycles-lane-picture-id1174752803?k=6&m=1174752803&s=612x612&w=0&h=DQaY7kZTpE6I2uxB6-uex9Hkigx7_yOHqOcj1c2XTr8=", "https://media.gettyimages.com/photos/bohemian-living-room-interior-3d-render-picture-id1182454657?k=6&m=1182454657&s=612x612&w=0&h=dRk1Cc_hNhVLhppNDh8XA6AXvUiknl5TwFvAOrJAuag=", "https://media.gettyimages.com/photos/modern-interior-picture-id853258138?k=6&m=853258138&s=612x612&w=0&h=C5HLeTPBLbnm2GwPvf8Z4FWvICPiXjP1qxfNpSNAuzU=", "https://media.gettyimages.com/photos/living-room-picture-id908753266?k=6&m=908753266&s=612x612&w=0&h=HgE08xc9jJEy3m9VT8bXbhv2nGlLnqluz4peyOd2Ixg=", "https://media.gettyimages.com/photos/top-stories-of-colorful-williamsburg-apartment-buildings-with-steel-picture-id877226544?k=6&m=877226544&s=612x612&w=0&h=WMR8BmUp5z4cjzgPT_tpjNeYO_f4QBxHXdFQR2knXbA=", "https://media.gettyimages.com/photos/corner-of-an-apartment-building-dubai-uae-picture-id1088862160?k=6&m=1088862160&s=612x612&w=0&h=crYN1VnUbFMh5cl1NFAEn1hZ325MuYYCgIwrJe91wTU=", "https://media.gettyimages.com/photos/full-furnished-living-room-picture-id1149521187?k=6&m=1149521187&s=612x612&w=0&h=kUNSsZ3z1c9Iflsw6YD8Pofrs0H2oR-uOe58BjSpJhY=", "https://media.gettyimages.com/photos/real-estate-agent-and-businessman-customer-picture-id1058166532?k=6&m=1058166532&s=612x612&w=0&h=dY72BdMULU50g_ggpM6y6C2EBzG0ZJgnnpI9Mq1KJFg=", "https://media.gettyimages.com/photos/low-angle-view-of-building-against-sky-picture-id1019612202?k=6&m=1019612202&s=612x612&w=0&h=COoVytXJJIai8RpnXTsl-IiGS9HNZGbeEuRPhL8xhk4=", "https://media.gettyimages.com/photos/rear-window-picture-id986735122?k=6&m=986735122&s=612x612&w=0&h=ceZm8L2BAjDQXnV3CPXmZGzvn7e90ZJHPv4hAHM2QBY=", "https://media.gettyimages.com/photos/modern-luxury-black-style-apartment-with-leather-sofa-picture-id592681584?k=6&m=592681584&s=612x612&w=0&h=gYaJCuuv1-f5YZjwe_L5_idBp6hVD0RHYJy1jkHllEk=", "https://media.gettyimages.com/photos/is-that-the-neighbour-lets-wave-hello-picture-id1153991492?k=6&m=1153991492&s=612x612&w=0&h=S_GRNiHYSfDH9wDDuRUBwoyvc8qvhgC7joTIxMX5Xv8=", "https://media.gettyimages.com/photos/this-city-looks-so-pretty-picture-id486500728?k=6&m=486500728&s=612x612&w=0&h=T33PtgawupuM1xnE7qmZUuaLxpl3KwhqnPqab3ObceE=", "https://media.gettyimages.com/photos/luxury-and-cozy-small-living-room-for-young-and-wild-people-picture-id939846660?k=6&m=939846660&s=612x612&w=0&h=_NfOsqj7ocMuPAkUnz4_uY1s6N78PRWoOvlMYwDCZsQ=", "https://media.gettyimages.com/photos/fresh-and-modern-white-style-living-room-interior-picture-id598928736?k=6&m=598928736&s=612x612&w=0&h=reQ1TFmDn-q2dnxzsJsvJAg3O7um9O8bVEXgrBmjS60=", "https://media.gettyimages.com/photos/modern-scandinavian-living-room-interior-3d-render-picture-id1184204517?k=6&m=1184204517&s=612x612&w=0&h=AxST5ofD-jHSpejD-WQVihuD_2nxgbm-kSgh0O4Ue_0=", "https://media.gettyimages.com/photos/living-room-with-record-collection-picture-id922780178?k=6&m=922780178&s=612x612&w=0&h=s3y4D-sF3XIiEAoA6KuLY3oujhvS6VMGeA4Se0zS2as=", "https://media.gettyimages.com/photos/modern-hipster-apartment-interior-picture-id842254818?k=6&m=842254818&s=612x612&w=0&h=ThwHN-gRPa55W21t7qZhfiSLi2Iazv66hrp-uvy9Exg=", "https://media.gettyimages.com/photos/imaginary-home-picture-id903424332?k=6&m=903424332&s=612x612&w=0&h=pTuCUEwDGH-sQl4OhlwMnDzb64WSb9rwOv5WC84B-g0=", "https://media.gettyimages.com/photos/happy-family-picture-id539234375?k=6&m=539234375&s=612x612&w=0&h=xjLm3u2Xp3gDOcvzvtQdz5voaQHmb4lZARULmGXasac=", "https://media.gettyimages.com/photos/illuminated-residential-building-picture-id1002993164?k=6&m=1002993164&s=612x612&w=0&h=iz2lss_Q4oEadPrfBbrGSI3yFMZgx5eCUIo4-VrIERo=", "https://media.gettyimages.com/photos/interior-living-room-picture-id875707508?k=6&m=875707508&s=612x612&w=0&h=Z-NmqMoI7j9Au1Eu02KWnDDFABnD6NLtEWV-byY5cgk=", "https://media.gettyimages.com/photos/studio-apartment-in-moscowcity-picture-id1045273588?k=6&m=1045273588&s=612x612&w=0&h=308TZsesG3wpPVaCalru3J-Gd1XWRjqa7ylXvaNASmg=", "https://media.gettyimages.com/photos/living-room-hdr-picture-id1021794474?k=6&m=1021794474&s=612x612&w=0&h=g3Xnsl3dZVrEt-8Rv36vG2mi4oWVwC6trhboM51bJfU=", "https://media.gettyimages.com/photos/the-suns-up-and-so-is-my-mood-picture-id911999972?k=6&m=911999972&s=612x612&w=0&h=dimamyIp4K_FgUZGEdHI3ZmGptgJPtm0vzfbxIQ7vM4=", "https://media.gettyimages.com/photos/couple-having-coffee-together-in-living-room-picture-id1093929566?k=6&m=1093929566&s=612x612&w=0&h=b6WxErxWy-AH-CJPMvQ7DCU3SdrIQfqS_hisZCwVDEg=", "https://media.gettyimages.com/photos/armchair-in-living-room-picture-id805011628?k=6&m=805011628&s=612x612&w=0&h=0P9cj-CzG7ecggfiBJsDS92rMSCUh33g--3TyDEjK-Q=", "https://media.gettyimages.com/photos/cozy-house-interior-picture-id953804632?k=6&m=953804632&s=612x612&w=0&h=2lmsS95-7k_t7xWhdM9y4bzeFAs3__KYplr9pQ8F-HE=", "https://media.gettyimages.com/photos/beautiful-girl-eating-pizza-in-a-modern-kitchen-picture-id910844022?k=6&m=910844022&s=612x612&w=0&h=jV3fRlAs7lPNzdG0-sLF-qKK3TL8lXp0dvOS02D0s6s=", "https://media.gettyimages.com/photos/scandinavian-style-living-room-interior-picture-id1136796476?k=6&m=1136796476&s=612x612&w=0&h=qxGwZSNnCQkHnsE5OisKfSv0Lhh5o0ypAnRSsB6PjmY=", "https://media.gettyimages.com/photos/empty-attic-flat-picture-id673115193?k=6&m=673115193&s=612x612&w=0&h=_WvfZtTco09ZnoCGp2BaDnfcun6QRrcvDreY-LSE0FM=", "https://media.gettyimages.com/photos/multifamily-housing-construction-picture-id1163226282?k=6&m=1163226282&s=612x612&w=0&h=W4kVhXhLUqtbEazf2WiQvI4BGWRFyLKTqm2cOVA3bOI=", "https://media.gettyimages.com/photos/tenements-in-sunset-park-brooklyn-new-york-city-picture-id1085642968?k=6&m=1085642968&s=612x612&w=0&h=YUz8On5cTTUDpErrD2IJ7ERT7RndwxEkK22jVdLJXHc=", "https://media.gettyimages.com/photos/cant-wait-someone-take-me-for-a-walk-picture-id1179741820?k=6&m=1179741820&s=612x612&w=0&h=Am-w1oW1f7t2U5dujKe71oZ9osWT1ikt9cpE3p2Plu4=", "https://media.gettyimages.com/photos/young-couple-choosing-the-right-color-for-their-wall-while-renovating-picture-id922010262?k=6&m=922010262&s=612x612&w=0&h=rnGHHgbQvOeUYv_OSLGXzW8Nc1tgraebvJVXYdKYpK8=", "https://media.gettyimages.com/photos/modern-living-room-picture-id1010758368?k=6&m=1010758368&s=612x612&w=0&h=16_4ipsRyhUw3ArThJOLbTMPB3rV8dtXzYIOK70QBio=", "https://media.gettyimages.com/photos/bohemian-living-room-interior-3d-render-picture-id1182454305?k=6&m=1182454305&s=612x612&w=0&h=nGpuVzzWgt-9cvVG-fQS1bIKQOlOan9tOtKasoxd3GM=", "https://media.gettyimages.com/photos/scandinavian-style-living-and-dining-room-picture-id1172217300?k=6&m=1172217300&s=612x612&w=0&h=PCad-hDV6iPpcjCQ-XvCIh6IdmL81hJ959cTlzIMjBs=", "https://media.gettyimages.com/photos/busy-mornings-together-picture-id870771014?k=6&m=870771014&s=612x612&w=0&h=UdAKxkOEBKxKoQhWjOXsDkMTi-TaHPcVPKBoYA55TfM=", "https://media.gettyimages.com/photos/loft-apartment-kitchen-picture-id520781269?k=6&m=520781269&s=612x612&w=0&h=eSpW6xrmVEOFvvV3ZQV_rm38oAkv18cH71nx3InLrrg=", "https://media.gettyimages.com/photos/city-life-downtown-toronto-vibrant-cityscape-skyline-picture-id474275680?k=6&m=474275680&s=612x612&w=0&h=25uLx5LAOTrAI16-qsuo0VK659VuelEZFuED8rJ_hLE=", "https://media.gettyimages.com/photos/mortgage-for-condo-picture-id957951430?k=6&m=957951430&s=612x612&w=0&h=X6yaSvQoeOwl66dD21kTYcJ6ksu6waFQ0tHK3ruPF4A=", "https://media.gettyimages.com/photos/young-cheerful-couple-communicating-after-relocating-into-new-picture-id932723056?k=6&m=932723056&s=612x612&w=0&h=TIff5NRm85f2hsCRfLDEPEl0T0MHKg6ueYHJKB8bT_o=", "https://media.gettyimages.com/photos/illuminated-building-at-night-picture-id1164323660?k=6&m=1164323660&s=612x612&w=0&h=UflRAEM4pCYOrJDm-WUQXXMfIxLPactVdniWtm1On90=", "https://media.gettyimages.com/photos/furniture-arranged-in-living-room-picture-id1156011692?k=6&m=1156011692&s=612x612&w=0&h=ADt-5T7oRmJNOrnbNCDhi8LyezCdvJlfRX1lg0iVqAw=", "https://media.gettyimages.com/photos/we-love-you-so-much-picture-id681221934?k=6&m=681221934&s=612x612&w=0&h=zeqXBKB1AMmun4L-dGoEnqJj8lzwJZuuu5LArgkoatE=", "https://media.gettyimages.com/photos/modern-scandinavian-living-room-interior-3d-render-picture-id1174450689?k=6&m=1174450689&s=612x612&w=0&h=_ZJ0HGvebEW7CyHp9LXgLIoLRn6SJykSJa583HsWYxA=", "https://media.gettyimages.com/photos/spacious-living-room-picture-id697563365?k=6&m=697563365&s=612x612&w=0&h=YZpERxR2J4blV8iuhGhp_Q2pnReFVVfyhbhuUei0l3E=", "https://media.gettyimages.com/photos/backlit-apartment-building-against-dramatic-sky-picture-id185108679?k=6&m=185108679&s=612x612&w=0&h=_1Ig3Td_akj8Jd58hK4dMpqRrkyyCBmH1s9KOFo0Ybc=", "https://media.gettyimages.com/photos/interior-of-new-york-style-loft-holiday-rental-apartment-picture-id825875078?k=6&m=825875078&s=612x612&w=0&h=2IrdA6IJYdEoQ5jCTcQUfZjm4UFBPlfRuvVAMTQIMW0=", "https://media.gettyimages.com/photos/giving-their-new-home-a-touch-of-modern-flair-with-stylish-furniture-picture-id874810786?k=6&m=874810786&s=612x612&w=0&h=Zc0iJs2-gfCCQErvCrX7LmoLYANVt5eTt7dfgjIvSnc=", "https://media.gettyimages.com/photos/happy-in-our-new-family-home-picture-id966587514?k=6&m=966587514&s=612x612&w=0&h=NI9hqv1_WBkBHMzciTj4_ix3mo8e-Hs8UquyIuT6Dig=", "https://media.gettyimages.com/photos/bangkok-apartment-picture-id920309862?k=6&m=920309862&s=612x612&w=0&h=fWft2x-BRgBCO06QbEw28HyyLk_Zm19yJ2CLOgj8TDQ=", "https://media.gettyimages.com/photos/young-happy-couple-holding-hands-and-talking-on-a-penthouse-terrace-picture-id935964376?k=6&m=935964376&s=612x612&w=0&h=VAZnIsoNPEpTEtdHfRZjwjss7IrjZzhERXLUZpofayY=", "https://media.gettyimages.com/photos/lit-room-picture-id596107281?k=6&m=596107281&s=612x612&w=0&h=MHk1p1xC_NLOY3qWQMqxCNW1AH4X5KkhJ-NWn19Q4N4=", "https://media.gettyimages.com/photos/low-angle-view-of-modern-building-picture-id683756667?k=6&m=683756667&s=612x612&w=0&h=epzjG8-pMZL_UVQjqg_bMR57_oClW1ptsG5rOSyySuc=", "https://media.gettyimages.com/photos/man-hand-opening-the-door-of-the-luxurious-hotel-room-picture-id915150546?k=6&m=915150546&s=612x612&w=0&h=oeWfpOKSQoRlU7zSF-Pgfk50CIbgkvD6uAvrHig8Rt0=", "https://media.gettyimages.com/photos/this-is-our-new-start-picture-id944039306?k=6&m=944039306&s=612x612&w=0&h=GiKsRgUOJ6KDwTdLAIsIEHflnuqdykcBMch7awluSjo=", "https://media.gettyimages.com/photos/cityscape-with-facade-of-a-modern-residential-building-picture-id1150016488?k=6&m=1150016488&s=612x612&w=0&h=9lTtY5TBVT24WQSXVKKpf68yq3Q28-7tUNOJTUaCk_U=", "https://media.gettyimages.com/photos/classic-scandinavian-bedroom-picture-id850262790?k=6&m=850262790&s=612x612&w=0&h=0Ne6947mKxtkstPeJUJEZtgzG1FXY26XgC5wbA7OrE0="]

all_apartments = Apartment.all.size

apartment_images.each do |image|
  Image.create(url: image, apartment_id: rand(1..all_apartments))
end
