adminpanel 2.6.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/adminpanel.gemspec +6 -6
- data/app/assets/images/adminpanel/magnifier.png +0 -0
- data/app/assets/javascripts/adminpanel/bootstrap-data-confirm.coffee.erb +142 -0
- data/app/assets/javascripts/adminpanel/dom-filter.coffee +15 -0
- data/app/assets/javascripts/adminpanel/dropzone.js +1728 -0
- data/app/assets/javascripts/adminpanel/filter-side-menu.coffee +4 -0
- data/app/assets/javascripts/adminpanel/gallery.js.coffee.erb +79 -0
- data/app/assets/javascripts/adminpanel/realm.js +0 -3
- data/app/assets/stylesheets/adminpanel/_search-input.scss.erb +11 -0
- data/app/assets/stylesheets/adminpanel/bootstrap.css.erb +1 -1
- data/app/assets/stylesheets/adminpanel/dropzone.css +515 -0
- data/app/assets/stylesheets/adminpanel/theme.css.scss.erb +1 -1
- data/app/controllers/adminpanel/analytics_controller.rb +7 -51
- data/app/controllers/adminpanel/application_controller.rb +1 -0
- data/app/controllers/adminpanel/roles_controller.rb +4 -1
- data/app/controllers/adminpanel/sections_controller.rb +1 -7
- data/app/controllers/concerns/adminpanel/facebook_actions.rb +3 -0
- data/app/controllers/concerns/adminpanel/gallery_actions.rb +31 -0
- data/app/controllers/concerns/adminpanel/rest_actions.rb +4 -1
- data/app/helpers/adminpanel/analytics_helper.rb +8 -18
- data/app/helpers/adminpanel/application_helper.rb +10 -2
- data/app/helpers/adminpanel/router_helper.rb +6 -2
- data/app/helpers/adminpanel/shared_pages_helper.rb +5 -3
- data/app/models/adminpanel/analytic.rb +4 -0
- data/app/models/adminpanel/image.rb +31 -0
- data/app/models/adminpanel/sectionfile.rb +1 -3
- data/app/models/concerns/adminpanel/base.rb +51 -7
- data/app/models/concerns/adminpanel/sortable_gallery.rb +12 -17
- data/app/views/adminpanel/analytics/_header.html.erb +1 -1
- data/app/views/adminpanel/form/_adminpanel_file_field.html.erb +27 -23
- data/app/views/adminpanel/icons/_delete.html.erb +1 -0
- data/app/views/adminpanel/sections/edit.html.erb +1 -12
- data/app/views/adminpanel/shared/_form_fields.html.erb +1 -0
- data/app/views/adminpanel/templates/destroy.js.erb +3 -0
- data/app/views/adminpanel/templates/index.html.erb +4 -4
- data/app/views/adminpanel/templates/show.html.erb +57 -52
- data/app/views/layouts/adminpanel/_side_menu.html.erb +18 -3
- data/config/initializers/adminpanel/assets.rb +4 -0
- data/config/locales/en.yml +24 -9
- data/config/locales/es.yml +18 -33
- data/config/routes.rb +10 -5
- data/lib/adminpanel/version.rb +1 -1
- data/lib/generators/adminpanel/gallery/gallery_generator.rb +0 -8
- data/lib/generators/adminpanel/gallery/templates/gallery_template.rb +7 -18
- data/lib/generators/adminpanel/gallery/templates/uploader.rb +1 -1
- data/lib/generators/adminpanel/initialize/templates/create_adminpanel_tables.rb +9 -5
- data/lib/generators/adminpanel/resource/resource_generator.rb +12 -16
- data/lib/generators/adminpanel/resource/resource_generator_helper.rb +23 -16
- data/test/dummy/.gitignore +2 -2
- data/test/dummy/app/controllers/adminpanel/products_controller.rb +1 -1
- data/test/dummy/app/models/adminpanel/galleryfile.rb +1 -13
- data/test/dummy/app/models/adminpanel/photo.rb +2 -9
- data/test/dummy/app/models/adminpanel/product.rb +1 -0
- data/test/dummy/config/initializers/carrierwave.rb +5 -0
- data/test/dummy/db/schema.rb +10 -18
- data/test/dummy/test/fixtures/adminpanel/galleries.yml +3 -3
- data/test/dummy/test/fixtures/adminpanel/images.yml +60 -0
- data/test/dummy/test/fixtures/adminpanel/products.yml +2 -2
- data/test/dummy/test/fixtures/{dog fries.png → attachments/dog-fries.png} +0 -0
- data/test/dummy/test/fixtures/attachments/hipster.jpg +0 -0
- data/test/dummy/test/fixtures/attachments/thumb_hipster.jpg +0 -0
- data/test/features/shared/form/belongs_to_remote_test.rb +1 -4
- data/test/features/shared/form/resource_field_test.rb +1 -1
- data/test/features/shared/resource/edit_test.rb +2 -5
- data/test/features/shared/resource/new_test.rb +5 -2
- data/test/features/shared/ui/dropzone_element_generation_test.rb +27 -0
- data/test/features/shared/ui/filtering_test.rb +29 -0
- data/test/generators/gallery_generator_test.rb +0 -10
- data/test/generators/resource_generator_test.rb +30 -6
- data/test/helpers/shared_pages_helper_test.rb +22 -43
- data/test/models/adminpanel/image_test.rb +31 -0
- data/test/models/adminpanel/sortable_gallery_unit_test.rb +8 -8
- data/test/support/view_case.rb +2 -2
- metadata +53 -43
- data/app/assets/images/adminpanel/dialogs.png +0 -0
- data/app/assets/images/adminpanel/icons-big.png +0 -0
- data/app/assets/images/adminpanel/icons-small.png +0 -0
- data/app/assets/images/adminpanel/select2.png +0 -0
- data/app/assets/images/adminpanel/select2x2.png +0 -0
- data/app/assets/images/adminpanel/toolbar.png +0 -0
- data/app/assets/javascripts/adminpanel/jquery.knob.js +0 -652
- data/app/assets/javascripts/adminpanel/jquery.masonry.min.js +0 -10
- data/app/assets/javascripts/adminpanel/jquery.slimscroll.min.js +0 -14
- data/app/views/adminpanel/analytics/_fb_statistic_widget.html.erb +0 -63
- data/app/views/adminpanel/analytics/fb.html.erb +0 -106
- data/test/dummy/config/carrierwave.rb +0 -6
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/fixtures/adminpanel/galleryfiles.yml +0 -42
- data/test/features/shared/ui/max_images_gallery_test.rb +0 -51
data/config/routes.rb
CHANGED
|
@@ -9,8 +9,6 @@ Adminpanel::Engine.routes.draw do
|
|
|
9
9
|
collection do
|
|
10
10
|
get :google, to: 'analytics#google', path: 'google'
|
|
11
11
|
|
|
12
|
-
get :fb, to:'analytics#fb', path:'facebook'
|
|
13
|
-
|
|
14
12
|
get :twitter, to:'analytics#twitter', path:'twitter'
|
|
15
13
|
post 'reply_to_tweet/:id', to: 'analytics#reply_to_tweet', as: 'reply_to', path: "twitter/#{I18n.t('routes.reply')}/:id"
|
|
16
14
|
post 'favorite_tweet/:id', to: 'analytics#favorite_tweet', as: 'favorite', path: "twitter/#{I18n.t('routes.favorite')}/:id"
|
|
@@ -22,10 +20,12 @@ Adminpanel::Engine.routes.draw do
|
|
|
22
20
|
end
|
|
23
21
|
else
|
|
24
22
|
if gallery_is_sortable?(resource)
|
|
23
|
+
sortable_galleries(resource).each do |sortable_gallery_resource|
|
|
25
24
|
# included sortable_gallery
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
resources sortable_gallery_resource.first.pluralize, only: [:index] do
|
|
26
|
+
member do
|
|
27
|
+
put :move_to_position, as: 'move_to_position', path: I18n.t('routes.move_to_position')
|
|
28
|
+
end
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -64,6 +64,11 @@ Adminpanel::Engine.routes.draw do
|
|
|
64
64
|
send(request_type, args['path'].to_sym, args['args'])
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
|
+
|
|
68
|
+
if has_gallery?(resource)
|
|
69
|
+
post :add_to_gallery, to: "#{resource}#add_to_gallery", as: 'add_to_gallery', path: I18n.t('routes.add_to_gallery')
|
|
70
|
+
delete :remove_image, to: "#{resource}#remove_image", as: 'remove_image', path: I18n.t('routes.remove_image')
|
|
71
|
+
end
|
|
67
72
|
end
|
|
68
73
|
end
|
|
69
74
|
end
|
data/lib/adminpanel/version.rb
CHANGED
|
@@ -12,14 +12,6 @@ module Adminpanel
|
|
|
12
12
|
template 'uploader.rb', "app/uploaders/adminpanel/#{lower_name}_uploader.rb"
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def generate_migration
|
|
16
|
-
migration_template(
|
|
17
|
-
'gallery_migration.rb',
|
|
18
|
-
"db/migrate/create_adminpanel_#{lower_name.pluralize}.rb"
|
|
19
|
-
)
|
|
20
|
-
puts "don't forget to add the form_field, the relationship and #{lower_name}s_attributes it to the permited params"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
15
|
private
|
|
24
16
|
def reference_name
|
|
25
17
|
name.singularize.downcase
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
module Adminpanel
|
|
2
|
-
class <%= class_name %> <
|
|
3
|
-
include Adminpanel::Base
|
|
2
|
+
class <%= class_name %> < Image
|
|
4
3
|
# include Adminpanel::SortableGallery
|
|
5
4
|
|
|
6
|
-
belongs_to :<%= reference_name %>
|
|
7
|
-
|
|
8
5
|
mount_uploader :file, <%= class_name %>Uploader
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#
|
|
13
|
-
#
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Warning: This method prevents the file from recreating versions,
|
|
9
|
+
# use it at your own risk delete the original file
|
|
10
|
+
# def remove_original attachment
|
|
11
|
+
# File.delete "#{Rails.root.join('public')}#{file_url}" if file
|
|
14
12
|
# end
|
|
15
|
-
|
|
16
|
-
# def self.display_name
|
|
17
|
-
# '<%= class_name %>'
|
|
18
|
-
# end
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
def remove_attachment
|
|
22
|
-
self.remove_file!
|
|
23
|
-
end
|
|
24
13
|
end
|
|
25
14
|
end
|
|
@@ -16,7 +16,7 @@ class CreateAdminpanelTables < ActiveRecord::Migration
|
|
|
16
16
|
create_permissions
|
|
17
17
|
create_auths
|
|
18
18
|
create_sections
|
|
19
|
-
|
|
19
|
+
create_images
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
private
|
|
@@ -33,10 +33,14 @@ class CreateAdminpanelTables < ActiveRecord::Migration
|
|
|
33
33
|
add_index :adminpanel_users, [:remember_token]
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
def
|
|
37
|
-
create_table :
|
|
38
|
-
t.string
|
|
39
|
-
t.integer :
|
|
36
|
+
def create_images
|
|
37
|
+
create_table :adminpanel_images do |t|
|
|
38
|
+
t.string :file
|
|
39
|
+
t.integer :model_id
|
|
40
|
+
t.string :model_type
|
|
41
|
+
t.string :type
|
|
42
|
+
t.string :file_size
|
|
43
|
+
t.string :content_type
|
|
40
44
|
t.timestamps
|
|
41
45
|
end
|
|
42
46
|
end
|
|
@@ -17,26 +17,21 @@ module Adminpanel
|
|
|
17
17
|
banner: 'field[:type][:index] field[:type][:index]'
|
|
18
18
|
|
|
19
19
|
def change_fields_aliases
|
|
20
|
-
|
|
20
|
+
attrs_to_delete = []
|
|
21
21
|
fields.each do |attribute|
|
|
22
22
|
case attribute.split(':').second
|
|
23
23
|
when 'wysiwyg'
|
|
24
|
-
|
|
24
|
+
attrs_to_delete << attribute
|
|
25
25
|
fields << attribute.split(':').first + ':' + 'text'
|
|
26
26
|
when 'datepicker'
|
|
27
|
-
|
|
27
|
+
attrs_to_delete << attribute
|
|
28
28
|
fields << attribute.split(':').first + ':' + 'date'
|
|
29
|
-
when 'belongs_to'
|
|
30
|
-
fields_to_delete << attribute
|
|
31
|
-
fields << attribute.split(':').first + ':' + 'select'
|
|
32
29
|
when 'has_many'
|
|
33
|
-
|
|
30
|
+
attrs_to_delete << attribute
|
|
34
31
|
fields << attribute.split(':').first + ':' + 'checkbox'
|
|
35
32
|
end
|
|
36
33
|
end
|
|
37
|
-
|
|
38
|
-
fields.delete(field)
|
|
39
|
-
end
|
|
34
|
+
attrs_to_delete.each { |f| fields.delete(f) }
|
|
40
35
|
end
|
|
41
36
|
|
|
42
37
|
def generate_model
|
|
@@ -51,17 +46,18 @@ module Adminpanel
|
|
|
51
46
|
|
|
52
47
|
def generate_migration
|
|
53
48
|
parameters = fields.dup
|
|
54
|
-
parameters.delete_if
|
|
55
|
-
|
|
56
|
-
end
|
|
49
|
+
parameters.delete_if { |pair| pair.split(':').second == 'checkbox' }
|
|
50
|
+
attrs_to_delete = []
|
|
57
51
|
parameters.each do |attribute|
|
|
58
52
|
case attribute.split(':').second
|
|
59
|
-
when 'file'
|
|
60
|
-
|
|
53
|
+
when 'file', 'image'
|
|
54
|
+
attrs_to_delete << attribute
|
|
61
55
|
parameters << attribute.split(':').first + ':' + 'string'
|
|
62
56
|
end
|
|
63
57
|
end
|
|
58
|
+
attrs_to_delete.each { |a| parameters.delete(a) }
|
|
64
59
|
parameters << 'created_at:datetime' << 'updated_at:datetime'
|
|
60
|
+
|
|
65
61
|
invoke :migration, ["create_adminpanel_#{pluralized_name}", parameters]
|
|
66
62
|
end
|
|
67
63
|
|
|
@@ -75,7 +71,7 @@ module Adminpanel
|
|
|
75
71
|
fields.each do |attribute|
|
|
76
72
|
assign_attributes_variables(attribute)
|
|
77
73
|
case @attr_type
|
|
78
|
-
when 'file'
|
|
74
|
+
when 'file', 'image'
|
|
79
75
|
template '../../gallery/templates/uploader.rb', "app/uploaders/adminpanel/#{class_name.underscore}_uploader.rb"
|
|
80
76
|
end
|
|
81
77
|
end
|
|
@@ -11,7 +11,7 @@ module Adminpanel
|
|
|
11
11
|
"#{resource_name}_#{@attr_field}".camelize
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def
|
|
14
|
+
def belongs_to_field(resource)
|
|
15
15
|
"#{resource.singularize.downcase}_id"
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -35,7 +35,7 @@ module Adminpanel
|
|
|
35
35
|
def is_a_resource?
|
|
36
36
|
fields.each do |attribute|
|
|
37
37
|
assign_attributes_variables(attribute)
|
|
38
|
-
if @attr_type != '
|
|
38
|
+
if @attr_type != 'belongs_to'
|
|
39
39
|
return true
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -66,8 +66,8 @@ module Adminpanel
|
|
|
66
66
|
fields.map do |attribute|
|
|
67
67
|
assign_attributes_variables(attribute)
|
|
68
68
|
case @attr_type
|
|
69
|
-
when '
|
|
70
|
-
":#{
|
|
69
|
+
when 'belongs_to'
|
|
70
|
+
":#{belongs_to_field(@attr_field)}"
|
|
71
71
|
when 'checkbox'
|
|
72
72
|
"{ #{checkbox_field(@attr_field)}: [] }"
|
|
73
73
|
else
|
|
@@ -103,6 +103,10 @@ module Adminpanel
|
|
|
103
103
|
attribute_hash(@attr_field, 'file_field')
|
|
104
104
|
end
|
|
105
105
|
|
|
106
|
+
def image_form_hash
|
|
107
|
+
attribute_hash(@attr_field, 'image_field')
|
|
108
|
+
end
|
|
109
|
+
|
|
106
110
|
def boolean_form_hash
|
|
107
111
|
attribute_hash(@attr_field, 'boolean')
|
|
108
112
|
end
|
|
@@ -115,12 +119,16 @@ module Adminpanel
|
|
|
115
119
|
attribute_hash(gallery_name.pluralize, 'adminpanel_file_field')
|
|
116
120
|
end
|
|
117
121
|
|
|
118
|
-
def
|
|
119
|
-
attribute_hash(
|
|
122
|
+
def belongs_to_form_hash
|
|
123
|
+
attribute_hash(belongs_to_field(@attr_field), 'select', resource_class_name(@attr_field))
|
|
120
124
|
end
|
|
121
125
|
|
|
122
126
|
def checkbox_form_hash
|
|
123
|
-
attribute_hash(
|
|
127
|
+
attribute_hash(
|
|
128
|
+
checkbox_field(resource_class_name(@attr_field.downcase.singularize + 's')),
|
|
129
|
+
'checkbox',
|
|
130
|
+
@attr_field.capitalize.singularize
|
|
131
|
+
)
|
|
124
132
|
end
|
|
125
133
|
|
|
126
134
|
def attribute_hash(name, type, model = '')
|
|
@@ -156,11 +164,10 @@ module Adminpanel
|
|
|
156
164
|
def has_associations?
|
|
157
165
|
fields.each do |attribute|
|
|
158
166
|
assign_attributes_variables(attribute)
|
|
159
|
-
if( @attr_type == '
|
|
160
|
-
@attr_type == 'select' ||
|
|
167
|
+
if( @attr_type == 'belongs_to' ||
|
|
161
168
|
@attr_type == 'checkbox' ||
|
|
162
169
|
@attr_type == 'file' ||
|
|
163
|
-
has_gallery?
|
|
170
|
+
has_gallery?)
|
|
164
171
|
return true
|
|
165
172
|
end
|
|
166
173
|
end
|
|
@@ -172,12 +179,12 @@ module Adminpanel
|
|
|
172
179
|
fields.each do |attribute|
|
|
173
180
|
assign_attributes_variables(attribute)
|
|
174
181
|
case @attr_type
|
|
175
|
-
when '
|
|
176
|
-
association = "#{association}#{
|
|
182
|
+
when 'belongs_to'
|
|
183
|
+
association = "#{association}#{belongs_to_association(@attr_field)}"
|
|
177
184
|
when 'checkbox'
|
|
178
185
|
association = "#{association}#{checkbox_association(@attr_field)}"
|
|
179
|
-
when 'file'
|
|
180
|
-
association = "#{association}#{
|
|
186
|
+
when 'image', 'file'
|
|
187
|
+
association = "#{association}#{file_association(@attr_field)}"
|
|
181
188
|
end
|
|
182
189
|
end
|
|
183
190
|
|
|
@@ -188,7 +195,7 @@ module Adminpanel
|
|
|
188
195
|
association
|
|
189
196
|
end
|
|
190
197
|
|
|
191
|
-
def
|
|
198
|
+
def belongs_to_association(field)
|
|
192
199
|
"belongs_to :#{field.singularize.downcase}\n\t\t"
|
|
193
200
|
end
|
|
194
201
|
|
|
@@ -199,7 +206,7 @@ module Adminpanel
|
|
|
199
206
|
"dependent: :destroy\n\t\t"
|
|
200
207
|
end
|
|
201
208
|
|
|
202
|
-
def
|
|
209
|
+
def file_association(field)
|
|
203
210
|
"mount_uploader :#{field}, #{class_name}Uploader\n\t\t"
|
|
204
211
|
end
|
|
205
212
|
|
data/test/dummy/.gitignore
CHANGED
|
@@ -6,14 +6,14 @@ capybara-*.html
|
|
|
6
6
|
/tmp/test.log
|
|
7
7
|
/tmp/development.log
|
|
8
8
|
/db/*.sqlite3
|
|
9
|
-
/public/
|
|
9
|
+
/public/uploads
|
|
10
10
|
/coverage/
|
|
11
11
|
/spec/tmp
|
|
12
12
|
**.orig
|
|
13
13
|
rerun.txt
|
|
14
14
|
pickle-email-*.html
|
|
15
15
|
config/initializers/secret_token.rb
|
|
16
|
-
/public/uploads/
|
|
16
|
+
/public/uploads/tmp
|
|
17
17
|
|
|
18
18
|
## Environment normalisation:
|
|
19
19
|
/.bundle
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
module Adminpanel
|
|
2
|
-
class Galleryfile <
|
|
3
|
-
include Adminpanel::Base
|
|
2
|
+
class Galleryfile < Image
|
|
4
3
|
include Adminpanel::SortableGallery
|
|
5
4
|
|
|
6
|
-
belongs_to :gallery
|
|
7
|
-
|
|
8
5
|
mount_uploader :file, Adminpanel::PhotoUploader
|
|
9
|
-
|
|
10
|
-
def self.relation_field
|
|
11
|
-
'gallery_id'
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def self.display_name
|
|
15
|
-
'galleryfile'
|
|
16
|
-
end
|
|
17
|
-
|
|
18
6
|
end
|
|
19
7
|
end
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
module Adminpanel
|
|
2
|
-
class Photo <
|
|
3
|
-
include Adminpanel::Base
|
|
2
|
+
class Photo < Image
|
|
4
3
|
# include Adminpanel::SortableGallery
|
|
5
|
-
mount_uploader :file, PhotoUploader
|
|
6
|
-
belongs_to :product
|
|
7
|
-
|
|
8
|
-
def self.relation_method
|
|
9
|
-
'product_id'
|
|
10
|
-
end
|
|
11
|
-
|
|
4
|
+
mount_uploader :file, Adminpanel::PhotoUploader
|
|
12
5
|
end
|
|
13
6
|
end
|
data/test/dummy/db/schema.rb
CHANGED
|
@@ -26,18 +26,16 @@ ActiveRecord::Schema.define do
|
|
|
26
26
|
t.datetime :created_at, null: false
|
|
27
27
|
t.datetime :updated_at, null: false
|
|
28
28
|
end
|
|
29
|
-
create_table :
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
t.datetime :created_at, null: false
|
|
40
|
-
t.datetime :updated_at, null: false
|
|
29
|
+
create_table :adminpanel_images do |t|
|
|
30
|
+
t.string :file
|
|
31
|
+
t.integer :model_id
|
|
32
|
+
t.string :model_type
|
|
33
|
+
t.string :type
|
|
34
|
+
t.string :file_size
|
|
35
|
+
t.string :content_type
|
|
36
|
+
t.integer :position
|
|
37
|
+
t.datetime :created_at, null: false
|
|
38
|
+
t.datetime :updated_at, null: false
|
|
41
39
|
end
|
|
42
40
|
create_table :adminpanel_products do |t|
|
|
43
41
|
t.string :price
|
|
@@ -47,12 +45,6 @@ ActiveRecord::Schema.define do
|
|
|
47
45
|
t.datetime :created_at, null: false
|
|
48
46
|
t.datetime :updated_at, null: false
|
|
49
47
|
end
|
|
50
|
-
create_table :adminpanel_photos do |t|
|
|
51
|
-
t.string :file
|
|
52
|
-
t.text :product_id
|
|
53
|
-
t.datetime :created_at, null: false
|
|
54
|
-
t.datetime :updated_at, null: false
|
|
55
|
-
end
|
|
56
48
|
create_table :adminpanel_categories do |t|
|
|
57
49
|
t.string :name
|
|
58
50
|
t.string :model
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
one:
|
|
2
|
-
file: <%= File.open(Rails.root.join("
|
|
2
|
+
file: <%= File.open(Rails.root.join("test", "fixtures", "attachments", "hipster.jpg")) %>
|
|
3
3
|
position: 1
|
|
4
4
|
created_at: <%= Date.today %>
|
|
5
5
|
updated_at: <%= Date.today %>
|
|
6
6
|
two:
|
|
7
|
-
file: <%= File.open(Rails.root.join("
|
|
7
|
+
file: <%= File.open(Rails.root.join("test", "fixtures", "attachments", "hipster.jpg")) %>
|
|
8
8
|
position: 2
|
|
9
9
|
created_at: <%= Date.today %>
|
|
10
10
|
updated_at: <%= Date.today %>
|
|
11
11
|
three:
|
|
12
|
-
file: <%= File.open(Rails.root.join("
|
|
12
|
+
file: <%= File.open(Rails.root.join("test", "fixtures", "attachments", "hipster.jpg")) %>
|
|
13
13
|
position: 3
|
|
14
14
|
created_at: <%= Date.today %>
|
|
15
15
|
updated_at: <%= Date.today %>
|