rename files to id
@ -51,12 +51,12 @@ module Merged
|
|||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
delete
|
delete
|
||||||
|
File.delete self.filename_old
|
||||||
Image.save_all
|
Image.save_all
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete(reindex = true)
|
def delete
|
||||||
Image.delete( self.id )
|
Image.delete( self.id )
|
||||||
section.reset_index if reindex
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def save
|
def save
|
||||||
@ -74,6 +74,21 @@ module Merged
|
|||||||
image_root + "/" + self.name
|
image_root + "/" + self.name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filename_old
|
||||||
|
full_filename = self.name + "." + self.type
|
||||||
|
Rails.root.join(asset_root, full_filename)
|
||||||
|
end
|
||||||
|
def filename_new
|
||||||
|
full_filename = self.id.to_s + "." + self.type
|
||||||
|
Rails.root.join(asset_root, full_filename)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.transform
|
||||||
|
Image.all.each do |image|
|
||||||
|
File.rename image.filename_old , image.filename_new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def asset_root
|
def asset_root
|
||||||
|
@ -103,12 +103,5 @@ module Merged
|
|||||||
Section.reload
|
Section.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.transform
|
|
||||||
Section.all.each do |card|
|
|
||||||
card.image = card.image_old
|
|
||||||
card.save
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 260 KiB |
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 211 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 372 KiB After Width: | Height: | Size: 372 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 216 KiB |
Before Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 323 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 207 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 170 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 1021 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 362 KiB |
Before Width: | Height: | Size: 245 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 403 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 103 KiB |
@ -1,25 +1,4 @@
|
|||||||
---
|
---
|
||||||
- :name: 3dprinter_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 1279
|
|
||||||
:height: 457
|
|
||||||
:created_at: 2022-12-11 16:44:40.742136342 +02:00
|
|
||||||
:size: 63
|
|
||||||
:id: 1
|
|
||||||
- :name: cafe_about
|
|
||||||
:type: webp
|
|
||||||
:width: 2698
|
|
||||||
:height: 839
|
|
||||||
:created_at: 2022-12-11 16:44:40.750136271 +02:00
|
|
||||||
:size: 216
|
|
||||||
:id: 2
|
|
||||||
- :name: clay_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 1279
|
|
||||||
:height: 401
|
|
||||||
:created_at: 2022-12-11 16:44:40.751136262 +02:00
|
|
||||||
:size: 95
|
|
||||||
:id: 3
|
|
||||||
- :name: common_spaces
|
- :name: common_spaces
|
||||||
:type: webp
|
:type: webp
|
||||||
:width: 560
|
:width: 560
|
||||||
@ -27,20 +6,6 @@
|
|||||||
:created_at: 2022-12-11 16:44:40.753136245 +02:00
|
:created_at: 2022-12-11 16:44:40.753136245 +02:00
|
||||||
:size: 21
|
:size: 21
|
||||||
:id: 4
|
:id: 4
|
||||||
- :name: common_spaces_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 2558
|
|
||||||
:height: 880
|
|
||||||
:created_at: 2022-12-11 16:44:40.753136245 +02:00
|
|
||||||
:size: 200
|
|
||||||
:id: 5
|
|
||||||
- :name: common_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 3840
|
|
||||||
:height: 1040
|
|
||||||
:created_at: 2022-12-11 16:44:40.754136236 +02:00
|
|
||||||
:size: 322
|
|
||||||
:id: 6
|
|
||||||
- :name: conferences
|
- :name: conferences
|
||||||
:type: webp
|
:type: webp
|
||||||
:width: 1740
|
:width: 1740
|
||||||
@ -55,27 +20,6 @@
|
|||||||
:created_at: 2022-12-11 16:44:40.755136227 +02:00
|
:created_at: 2022-12-11 16:44:40.755136227 +02:00
|
||||||
:size: 135
|
:size: 135
|
||||||
:id: 8
|
:id: 8
|
||||||
- :name: double_office_small
|
|
||||||
:type: webp
|
|
||||||
:width: 602
|
|
||||||
:height: 480
|
|
||||||
:created_at: 2022-12-11 16:44:40.756136218 +02:00
|
|
||||||
:size: 25
|
|
||||||
:id: 9
|
|
||||||
- :name: earth_room
|
|
||||||
:type: webp
|
|
||||||
:width: 560
|
|
||||||
:height: 300
|
|
||||||
:created_at: 2022-12-11 16:44:40.756136218 +02:00
|
|
||||||
:size: 14
|
|
||||||
:id: 10
|
|
||||||
- :name: electronics_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 1279
|
|
||||||
:height: 401
|
|
||||||
:created_at: 2022-12-11 16:44:40.756136218 +02:00
|
|
||||||
:size: 96
|
|
||||||
:id: 11
|
|
||||||
- :name: en_suite_studio
|
- :name: en_suite_studio
|
||||||
:type: webp
|
:type: webp
|
||||||
:width: 560
|
:width: 560
|
||||||
@ -83,27 +27,6 @@
|
|||||||
:created_at: 2022-12-11 16:44:40.756136218 +02:00
|
:created_at: 2022-12-11 16:44:40.756136218 +02:00
|
||||||
:size: 13
|
:size: 13
|
||||||
:id: 12
|
:id: 12
|
||||||
- :name: feenix_logo_big
|
|
||||||
:type: png
|
|
||||||
:width: 780
|
|
||||||
:height: 940
|
|
||||||
:created_at: 2022-12-11 16:44:40.757136209 +02:00
|
|
||||||
:size: 206
|
|
||||||
:id: 13
|
|
||||||
- :name: floating_office_small
|
|
||||||
:type: webp
|
|
||||||
:width: 602
|
|
||||||
:height: 480
|
|
||||||
:created_at: 2022-12-11 16:44:40.758136200 +02:00
|
|
||||||
:size: 28
|
|
||||||
:id: 14
|
|
||||||
- :name: food_area
|
|
||||||
:type: webp
|
|
||||||
:width: 2558
|
|
||||||
:height: 880
|
|
||||||
:created_at: 2022-12-11 16:44:40.758136200 +02:00
|
|
||||||
:size: 169
|
|
||||||
:id: 15
|
|
||||||
- :name: house
|
- :name: house
|
||||||
:type: jpg
|
:type: jpg
|
||||||
:width: 1314
|
:width: 1314
|
||||||
@ -118,20 +41,6 @@
|
|||||||
:created_at: 2022-12-07 16:04:22.141547518 +02:00
|
:created_at: 2022-12-07 16:04:22.141547518 +02:00
|
||||||
:size: 211
|
:size: 211
|
||||||
:id: 17
|
:id: 17
|
||||||
- :name: loft_room
|
|
||||||
:type: webp
|
|
||||||
:width: 560
|
|
||||||
:height: 300
|
|
||||||
:created_at: 2022-12-11 16:44:40.760136182 +02:00
|
|
||||||
:size: 24
|
|
||||||
:id: 18
|
|
||||||
- :name: lotus_room
|
|
||||||
:type: webp
|
|
||||||
:width: 560
|
|
||||||
:height: 300
|
|
||||||
:created_at: 2022-12-11 16:44:40.760136182 +02:00
|
|
||||||
:size: 13
|
|
||||||
:id: 19
|
|
||||||
- :name: makerspace
|
- :name: makerspace
|
||||||
:type: webp
|
:type: webp
|
||||||
:width: 1059
|
:width: 1059
|
||||||
@ -139,34 +48,6 @@
|
|||||||
:created_at: 2022-12-11 16:44:40.760136182 +02:00
|
:created_at: 2022-12-11 16:44:40.760136182 +02:00
|
||||||
:size: 98
|
:size: 98
|
||||||
:id: 20
|
:id: 20
|
||||||
- :name: mandala_room
|
|
||||||
:type: webp
|
|
||||||
:width: 560
|
|
||||||
:height: 300
|
|
||||||
:created_at: 2022-12-11 16:44:40.761136174 +02:00
|
|
||||||
:size: 24
|
|
||||||
:id: 21
|
|
||||||
- :name: map_wide
|
|
||||||
:type: png
|
|
||||||
:width: 2169
|
|
||||||
:height: 1149
|
|
||||||
:created_at: 2022-12-11 16:44:40.761136174 +02:00
|
|
||||||
:size: 1020
|
|
||||||
:id: 22
|
|
||||||
- :name: metal_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 782
|
|
||||||
:height: 308
|
|
||||||
:created_at: 2022-12-11 16:44:40.765136138 +02:00
|
|
||||||
:size: 43
|
|
||||||
:id: 23
|
|
||||||
- :name: nature_around
|
|
||||||
:type: webp
|
|
||||||
:width: 2558
|
|
||||||
:height: 880
|
|
||||||
:created_at: 2022-12-11 16:44:40.765136138 +02:00
|
|
||||||
:size: 362
|
|
||||||
:id: 24
|
|
||||||
- :name: non_standard_room
|
- :name: non_standard_room
|
||||||
:type: webp
|
:type: webp
|
||||||
:width: 865
|
:width: 865
|
||||||
@ -209,34 +90,6 @@
|
|||||||
:created_at: 2022-12-11 16:44:40.769136102 +02:00
|
:created_at: 2022-12-11 16:44:40.769136102 +02:00
|
||||||
:size: 31
|
:size: 31
|
||||||
:id: 30
|
:id: 30
|
||||||
- :name: shared_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 3840
|
|
||||||
:height: 1020
|
|
||||||
:created_at: 2022-12-11 16:44:40.769136102 +02:00
|
|
||||||
:size: 245
|
|
||||||
:id: 31
|
|
||||||
- :name: single_office_small
|
|
||||||
:type: webp
|
|
||||||
:width: 602
|
|
||||||
:height: 580
|
|
||||||
:created_at: 2022-12-11 16:44:40.770136094 +02:00
|
|
||||||
:size: 57
|
|
||||||
:id: 32
|
|
||||||
- :name: sky_conference
|
|
||||||
:type: webp
|
|
||||||
:width: 560
|
|
||||||
:height: 300
|
|
||||||
:created_at: 2022-12-11 16:44:40.770136094 +02:00
|
|
||||||
:size: 146
|
|
||||||
:id: 33
|
|
||||||
- :name: sowing_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 780
|
|
||||||
:height: 262
|
|
||||||
:created_at: 2022-12-11 16:44:40.771136085 +02:00
|
|
||||||
:size: 28
|
|
||||||
:id: 34
|
|
||||||
- :name: standard
|
- :name: standard
|
||||||
:type: webp
|
:type: webp
|
||||||
:width: 1730
|
:width: 1730
|
||||||
@ -258,20 +111,6 @@
|
|||||||
:created_at: 2022-12-11 16:44:40.771136085 +02:00
|
:created_at: 2022-12-11 16:44:40.771136085 +02:00
|
||||||
:size: 372
|
:size: 372
|
||||||
:id: 37
|
:id: 37
|
||||||
- :name: suites_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 3840
|
|
||||||
:height: 1064
|
|
||||||
:created_at: 2022-12-11 16:44:40.772136076 +02:00
|
|
||||||
:size: 403
|
|
||||||
:id: 38
|
|
||||||
- :name: the_hall
|
|
||||||
:type: webp
|
|
||||||
:width: 560
|
|
||||||
:height: 300
|
|
||||||
:created_at: 2022-12-11 16:44:40.773136067 +02:00
|
|
||||||
:size: 19
|
|
||||||
:id: 39
|
|
||||||
- :name: wet_space_room
|
- :name: wet_space_room
|
||||||
:type: webp
|
:type: webp
|
||||||
:width: 865
|
:width: 865
|
||||||
@ -279,10 +118,3 @@
|
|||||||
:created_at: 2022-12-11 16:44:40.773136067 +02:00
|
:created_at: 2022-12-11 16:44:40.773136067 +02:00
|
||||||
:size: 29
|
:size: 29
|
||||||
:id: 40
|
:id: 40
|
||||||
- :name: woodworking_wide
|
|
||||||
:type: webp
|
|
||||||
:width: 1279
|
|
||||||
:height: 415
|
|
||||||
:created_at: 2022-12-11 16:44:40.773136067 +02:00
|
|
||||||
:size: 102
|
|
||||||
:id: 41
|
|
||||||
|