-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.rb
44 lines (41 loc) · 1002 Bytes
/
models.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'active_record'
load File.dirname(__FILE__) + '/schema.rb'
class Entity < ActiveRecord::Base
has_imgix_attachment :photo,
:subdomain => "imgix-subdomain",
:default => "default.png",
:prefix => "photos",
:styles => {
:thumb => {
:h => 90,
:w => 110,
:fit => "crop"
},
:large => {
:h => 480,
:w => 640,
:fit => "crop"
}
}
end
class CustomFieldsEntity < ActiveRecord::Base
has_imgix_attachment :photo,
:subdomain => "imgix-subdomain",
:default => "default.png",
:prefix => "photos",
:filename_field => "picture_name",
:file_size_field => "picture_size",
:content_type_field => "picture_type",
:styles => {
:thumb => {
:h => 90,
:w => 110,
:fit => "crop"
},
:large => {
:h => 480,
:w => 640,
:fit => "crop"
}
}
end