seven_gallery 0.0.1 → 0.0.2
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/app/controllers/seven_gallery/concerns/galleries_controller.rb +1 -1
- data/app/models/seven_gallery/concerns/gallery.rb +2 -2
- data/app/models/seven_gallery/concerns/photo.rb +1 -1
- data/db/migrate/20150329123256_create_seven_gallery_photos.rb +1 -1
- data/db/migrate/20150408131836_add_foreign_key_to_galleries.rb +5 -0
- data/lib/seven_gallery/version.rb +1 -1
- data/test/dummy/config/database.yml +6 -2
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +16 -15
- data/test/dummy/log/development.log +8901 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/1/20_846442_0442869001413626052.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/1/large_20_846442_0442869001413626052.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/1/thumb_20_846442_0442869001413626052.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/2/309497-family-guy-family-guy.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/2/large_309497-family-guy-family-guy.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/2/thumb_309497-family-guy-family-guy.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/3/10363744_10205384609639748_9018769622883916441_n.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/3/large_10363744_10205384609639748_9018769622883916441_n.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/3/thumb_10363744_10205384609639748_9018769622883916441_n.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/4/1398243758_unnamed.png +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/4/large_1398243758_unnamed.png +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/4/thumb_1398243758_unnamed.png +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/5/car_photo_327391.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/5/large_car_photo_327391.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/5/thumb_car_photo_327391.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/6/CentreMural.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/6/large_CentreMural.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/6/thumb_CentreMural.jpg +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/7/Huskies-and-Baby-800x530.png +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/7/large_Huskies-and-Baby-800x530.png +0 -0
- data/test/dummy/public/uploads/seven_gallery/photo/image/7/thumb_Huskies-and-Baby-800x530.png +0 -0
- metadata +58 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fa23cdf120f12888761c8ba25151a6257587c87
|
4
|
+
data.tar.gz: 48bd1d4a6e74ee91814208d2a32c0359ff13e691
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5bd2a039a8a521955bc1dbf09c9f5673dfc35facfee149fdbbdbe9535e9e65f778cc22b91c4cdecd03a15cc6e874804d610c0a5aa1bcccd43ae30ae898856b
|
7
|
+
data.tar.gz: e817dfdb4cd8b6aa6b3f0fc014d4e10b2d77aa165c3850b70ecf43e0d2663b760744258df15002519f3999eae256005931adff443d1e1c50fbc946bd65488aea
|
@@ -12,7 +12,7 @@ module SevenGallery::Concerns::GalleriesController
|
|
12
12
|
|
13
13
|
# GET /galleries/1
|
14
14
|
def show
|
15
|
-
@photos =
|
15
|
+
@photos = @gallery.photos.paginate(page: params[:page])
|
16
16
|
end
|
17
17
|
|
18
18
|
# GET /galleries/new
|
@@ -2,7 +2,7 @@ module SevenGallery::Concerns::Gallery
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
has_many :photos, dependent: :destroy
|
6
|
-
|
5
|
+
has_many :photos, class_name: "SevenGallery::Photo", foreign_key: "seven_gallery_gallery_id", dependent: :destroy
|
6
|
+
default_scope { order("created_at desc") }
|
7
7
|
end
|
8
8
|
end
|
@@ -2,7 +2,7 @@ module SevenGallery::Concerns::Photo
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
belongs_to :gallery
|
5
|
+
belongs_to :gallery, class_name: "SevenGallery::Gallery"
|
6
6
|
mount_uploader :image, SevenGallery::PhotoUploader
|
7
7
|
attr_accessor :crop_x, :crop_y, :crop_h, :crop_w
|
8
8
|
default_scope { order("position asc, created_at desc") }
|
@@ -3,7 +3,7 @@ class CreateSevenGalleryPhotos < ActiveRecord::Migration
|
|
3
3
|
create_table :seven_gallery_photos do |t|
|
4
4
|
t.string :caption
|
5
5
|
t.string :image
|
6
|
-
t.references :
|
6
|
+
t.references :seven_gallery_gallery, index: true
|
7
7
|
|
8
8
|
t.timestamps null: false
|
9
9
|
end
|
@@ -10,8 +10,12 @@ default: &default
|
|
10
10
|
timeout: 5000
|
11
11
|
|
12
12
|
development:
|
13
|
-
|
14
|
-
database:
|
13
|
+
adapter: mysql2
|
14
|
+
database: seven_gallery
|
15
|
+
username: root
|
16
|
+
password: root
|
17
|
+
# <<: *default
|
18
|
+
# database: db/development.sqlite3
|
15
19
|
|
16
20
|
# Warning: The database defined as "test" will be erased and
|
17
21
|
# re-generated from your development database when you run "rake".
|
Binary file
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,27 +11,28 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20150408131836) do
|
15
15
|
|
16
16
|
create_table "seven_gallery_galleries", force: :cascade do |t|
|
17
|
-
t.string "title"
|
18
|
-
t.datetime "created_at",
|
19
|
-
t.datetime "updated_at",
|
17
|
+
t.string "title", limit: 255
|
18
|
+
t.datetime "created_at", null: false
|
19
|
+
t.datetime "updated_at", null: false
|
20
20
|
end
|
21
21
|
|
22
22
|
create_table "seven_gallery_photos", force: :cascade do |t|
|
23
|
-
t.string "caption"
|
24
|
-
t.string "image"
|
25
|
-
t.integer "
|
26
|
-
t.datetime "created_at",
|
27
|
-
t.datetime "updated_at",
|
28
|
-
t.boolean "is_new",
|
29
|
-
t.boolean "is_featured", default: false
|
30
|
-
t.text "description"
|
31
|
-
t.string "alt"
|
32
|
-
t.integer "position",
|
23
|
+
t.string "caption", limit: 255
|
24
|
+
t.string "image", limit: 255
|
25
|
+
t.integer "seven_gallery_gallery_id", limit: 4
|
26
|
+
t.datetime "created_at", null: false
|
27
|
+
t.datetime "updated_at", null: false
|
28
|
+
t.boolean "is_new", limit: 1, default: true
|
29
|
+
t.boolean "is_featured", limit: 1, default: false
|
30
|
+
t.text "description", limit: 65535
|
31
|
+
t.string "alt", limit: 255
|
32
|
+
t.integer "position", limit: 4, default: 0
|
33
33
|
end
|
34
34
|
|
35
|
-
add_index "seven_gallery_photos", ["
|
35
|
+
add_index "seven_gallery_photos", ["seven_gallery_gallery_id"], name: "index_seven_gallery_photos_on_seven_gallery_gallery_id", using: :btree
|
36
36
|
|
37
|
+
add_foreign_key "seven_gallery_photos", "seven_gallery_galleries"
|
37
38
|
end
|