saphira 0.1.0.beta2 → 0.1.0.beta3
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.
- data/README.md +11 -5
- data/app/controllers/saphira/file_items_controller.rb +11 -11
- data/app/views/saphira/file_items/index.html.erb +1 -1
- data/lib/saphira/version.rb +1 -1
- data/test/dummy/config/initializers/wrap_parameters.rb +1 -1
- data/test/dummy/log/test.log +137 -0
- data/test/dummy/system/files/test/2011/09/06/17_27_54_786_eos_550d_wrong_orientation.jpg +0 -0
- data/test/dummy/system/files/test/2011/09/06/17_27_54_786_eos_550d_wrong_orientation.jpg.meta +1 -0
- data/test/functional/saphira/file_items_controller_test.rb +5 -5
- metadata +6 -2
data/README.md
CHANGED
@@ -14,16 +14,22 @@ Features
|
|
14
14
|
|
15
15
|
To-Do
|
16
16
|
-----
|
17
|
-
*
|
18
|
-
*
|
17
|
+
* Image manipulation
|
18
|
+
* A form helper for image cropping
|
19
|
+
* Multiple named image versions
|
19
20
|
* WebDav access
|
20
21
|
* Search files
|
21
22
|
|
22
23
|
Requirements
|
23
24
|
------------
|
24
|
-
* Rails 3.1.x
|
25
|
-
*
|
25
|
+
* [Rails 3.1.x](http://rubyonrails.org/)
|
26
|
+
* [dragonfly](https://github.com/markevans/dragonfly/): A Ruby Rack-based gem for on-the-fly processing - suitable for image uploading in Rails, Sinatra and much more!
|
27
|
+
* [awesome\_nested\_set](https://github.com/collectiveidea/awesome_nested_set): An awesome replacement for acts\_as\_nested\_set and better\_nested\_set.
|
28
|
+
* [exifr](https://github.com/remvee/exifr/): EXIF Reader
|
29
|
+
* [friendly_id](https://github.com/norman/friendly_id): It allows you to create pretty URL’s and work with human-friendly strings as if they were numeric ids for ActiveRecord models.
|
30
|
+
* [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on): A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
|
31
|
+
* _And some more gems in development mode_
|
26
32
|
|
27
33
|
Installation
|
28
34
|
------------
|
29
|
-
Add the gem to your gemfile: `gem 'saphira',
|
35
|
+
Add the gem to your gemfile: `gem 'saphira', '~> 0.1.0.beta2'` and add `mount Saphira::Engine => "/saphira", :as => 'saphira'` to your `routes.rb` file to mount the engine. The file manager should be available at `http://localhost:3000/saphira` then.
|
@@ -8,7 +8,7 @@ module Saphira
|
|
8
8
|
|
9
9
|
respond_to do |format|
|
10
10
|
format.html # index.html.erb
|
11
|
-
format.json { render json
|
11
|
+
format.json { render :json => @file_items }
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -27,7 +27,7 @@ module Saphira
|
|
27
27
|
render
|
28
28
|
end
|
29
29
|
end
|
30
|
-
format.json { render json
|
30
|
+
format.json { render :json => @file_item }
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -40,7 +40,7 @@ module Saphira
|
|
40
40
|
|
41
41
|
respond_to do |format|
|
42
42
|
format.html { render :action => "new_#{@file_item.item_type}" }
|
43
|
-
format.json { render json
|
43
|
+
format.json { render :json => @file_item }
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -50,7 +50,7 @@ module Saphira
|
|
50
50
|
|
51
51
|
respond_to do |format|
|
52
52
|
format.html { render :action => "edit_#{@file_item.item_type}" }
|
53
|
-
format.json { render json
|
53
|
+
format.json { render :json => @file_item }
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -61,11 +61,11 @@ module Saphira
|
|
61
61
|
|
62
62
|
respond_to do |format|
|
63
63
|
if @file_item.save
|
64
|
-
format.html { redirect_to @file_item, notice
|
65
|
-
format.json { render json
|
64
|
+
format.html { redirect_to @file_item, :notice => 'File item was successfully created.' }
|
65
|
+
format.json { render :json => @file_item, :status => :created, :location => @file_item }
|
66
66
|
else
|
67
|
-
format.html { render action
|
68
|
-
format.json { render json
|
67
|
+
format.html { render :action => "new_#{@file_item.item_type}" }
|
68
|
+
format.json { render :json => @file_item.errors, :status => :unprocessable_entity }
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
@@ -77,11 +77,11 @@ module Saphira
|
|
77
77
|
|
78
78
|
respond_to do |format|
|
79
79
|
if @file_item.update_attributes(params[:file_item])
|
80
|
-
format.html { redirect_to @file_item, notice
|
80
|
+
format.html { redirect_to @file_item, :notice => 'File item was successfully updated.' }
|
81
81
|
format.json { head :ok }
|
82
82
|
else
|
83
|
-
format.html { render action
|
84
|
-
format.json { render json
|
83
|
+
format.html { render :action => "edit_#{@file_item.item_type}" }
|
84
|
+
format.json { render :json => @file_item.errors, :status => :unprocessable_entity }
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<td><%= link_to image_tag('saphira/icons/32x32/'+file_item.item_type+'.png'), file_item %></td>
|
15
15
|
<td><%= link_to file_item.name, file_item %></td>
|
16
16
|
<td><%= file_item.file.mime_type if file_item.file %></td>
|
17
|
-
<td class="actions"><%= link_to 'Destroy', file_item, confirm
|
17
|
+
<td class="actions"><%= link_to 'Destroy', file_item, :confirm => 'Are you sure?', :method => :delete, :id => "saphira-action-destroy-#{file_item.slug}" %></td>
|
18
18
|
</tr>
|
19
19
|
<% end %>
|
20
20
|
</table>
|
data/lib/saphira/version.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format
|
8
|
+
wrap_parameters :format => [:json]
|
9
9
|
end
|
10
10
|
|
11
11
|
# Disable root element in JSON by default.
|
data/test/dummy/log/test.log
CHANGED
@@ -497,3 +497,140 @@ Started GET "/admin/saphira/files/my-first-image" for 127.0.0.1 at 2011-09-05 09
|
|
497
497
|
[1m[35mSaphira::FileItem Load (0.2ms)[0m SELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."id" IS NULL LIMIT 1
|
498
498
|
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/show.html.erb within layouts/saphira/application (18.3ms)
|
499
499
|
Completed 200 OK in 24ms (Views: 21.0ms | ActiveRecord: 0.9ms)
|
500
|
+
|
501
|
+
|
502
|
+
Started GET "/admin/saphira/files" for 127.0.0.1 at 2011-09-06 17:27:53 +0200
|
503
|
+
Processing by Saphira::FileItemsController#index as HTML
|
504
|
+
[1m[36mSaphira::FileItem Load (0.9ms)[0m [1mSELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" IS NULL[0m
|
505
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/index.html.erb within layouts/saphira/application (83.3ms)
|
506
|
+
Completed 200 OK in 171ms (Views: 154.9ms | ActiveRecord: 1.1ms)
|
507
|
+
|
508
|
+
|
509
|
+
Started GET "/admin/saphira/files/new?type=folder" for 127.0.0.1 at 2011-09-06 17:27:53 +0200
|
510
|
+
Processing by Saphira::FileItemsController#new as HTML
|
511
|
+
Parameters: {"type"=>"folder"}
|
512
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.6ms)[0m SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" IS NULL AND "taggings"."taggable_type" = 'Saphira::FileItem' AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)
|
513
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/_form.html.erb (245.0ms)
|
514
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/new_folder.html.erb within layouts/saphira/application (262.6ms)
|
515
|
+
Completed 200 OK in 265ms (Views: 263.4ms | ActiveRecord: 1.0ms)
|
516
|
+
|
517
|
+
|
518
|
+
Started POST "/admin/saphira/files" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
519
|
+
Processing by Saphira::FileItemsController#create as HTML
|
520
|
+
Parameters: {"utf8"=>"✓", "file_item"=>{"name"=>"My first folder", "tag_list"=>"", "item_type"=>"folder", "parent_id"=>""}, "commit"=>"Create"}
|
521
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
522
|
+
[1m[35mSaphira::FileItem Load (0.2ms)[0m SELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" IS NULL AND ("slug" = 'my-first-folder' OR "slug" LIKE 'my-first-folder--%') ORDER BY LENGTH("slug") DESC, "slug" DESC LIMIT 1
|
523
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "saphira_file_items" WHERE ("saphira_file_items"."name" = 'My first folder' AND "saphira_file_items"."parent_id" IS NULL) LIMIT 1[0m
|
524
|
+
[1m[35m (0.5ms)[0m SELECT MAX("saphira_file_items"."rgt") AS max_id FROM "saphira_file_items"
|
525
|
+
[1m[36mSQL (9.0ms)[0m [1mINSERT INTO "saphira_file_items" ("created_at", "dynamic_attributes", "file_name", "file_uid", "item_type", "lft", "name", "parent_id", "path", "rgt", "slug", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00], ["dynamic_attributes", "--- \n"], ["file_name", nil], ["file_uid", nil], ["item_type", "folder"], ["lft", 1], ["name", "My first folder"], ["parent_id", nil], ["path", "my-first-folder"], ["rgt", 2], ["slug", "my-first-folder"], ["updated_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00]]
|
526
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.2ms)[0m SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 1 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)
|
527
|
+
[1m[36mActsAsTaggableOn::Tagging Load (0.1ms)[0m [1mSELECT "taggings".* FROM "taggings" WHERE "taggings"."taggable_id" = 1 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND "taggings"."tagger_type" IS NULL AND "taggings"."tagger_id" IS NULL AND "taggings"."context" = 'tags' AND "taggings"."tag_id" IN (NULL)[0m
|
528
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
529
|
+
Redirected to http://www.example.com/admin/saphira/files/my-first-folder
|
530
|
+
Completed 302 Found in 253ms
|
531
|
+
|
532
|
+
|
533
|
+
Started GET "/admin/saphira/files/my-first-folder" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
534
|
+
Processing by Saphira::FileItemsController#show as HTML
|
535
|
+
Parameters: {"id"=>"my-first-folder"}
|
536
|
+
[1m[36mSaphira::FileItem Load (0.2ms)[0m [1mSELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."path" = 'my-first-folder' LIMIT 1[0m
|
537
|
+
[1m[35mSaphira::FileItem Load (0.2ms)[0m SELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."id" IS NULL LIMIT 1
|
538
|
+
[1m[36mSaphira::FileItem Load (0.2ms)[0m [1mSELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" = 1 ORDER BY "lft"[0m
|
539
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/index.html.erb within layouts/saphira/application (20.5ms)
|
540
|
+
Completed 200 OK in 23ms (Views: 21.3ms | ActiveRecord: 0.5ms)
|
541
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
542
|
+
[1m[36mSaphira::FileItem Load (0.3ms)[0m [1mSELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" IS NULL AND ("slug" = 'my-first-folder' OR "slug" LIKE 'my-first-folder--%') ORDER BY LENGTH("slug") DESC, "slug" DESC LIMIT 1[0m
|
543
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "saphira_file_items" WHERE ("saphira_file_items"."name" = 'My first folder' AND "saphira_file_items"."parent_id" IS NULL) LIMIT 1
|
544
|
+
[1m[36m (0.1ms)[0m [1mSELECT MAX("saphira_file_items"."rgt") AS max_id FROM "saphira_file_items" [0m
|
545
|
+
[1m[35mSQL (1.2ms)[0m INSERT INTO "saphira_file_items" ("created_at", "dynamic_attributes", "file_name", "file_uid", "item_type", "lft", "name", "parent_id", "path", "rgt", "slug", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00], ["dynamic_attributes", "--- \n"], ["file_name", nil], ["file_uid", nil], ["item_type", "folder"], ["lft", 1], ["name", "My first folder"], ["parent_id", nil], ["path", "my-first-folder"], ["rgt", 2], ["slug", "my-first-folder"], ["updated_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00]]
|
546
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
547
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
548
|
+
[1m[36mSaphira::FileItem Load (0.2ms)[0m [1mSELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" IS NULL AND ("slug" = 'my-second-folder' OR "slug" LIKE 'my-second-folder--%') ORDER BY LENGTH("slug") DESC, "slug" DESC LIMIT 1[0m
|
549
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "saphira_file_items" WHERE ("saphira_file_items"."name" = 'My second folder' AND "saphira_file_items"."parent_id" IS NULL) LIMIT 1
|
550
|
+
[1m[36m (0.1ms)[0m [1mSELECT MAX("saphira_file_items"."rgt") AS max_id FROM "saphira_file_items" [0m
|
551
|
+
[1m[35mSQL (0.7ms)[0m INSERT INTO "saphira_file_items" ("created_at", "dynamic_attributes", "file_name", "file_uid", "item_type", "lft", "name", "parent_id", "path", "rgt", "slug", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00], ["dynamic_attributes", "--- \n"], ["file_name", nil], ["file_uid", nil], ["item_type", "folder"], ["lft", 3], ["name", "My second folder"], ["parent_id", nil], ["path", "my-second-folder"], ["rgt", 4], ["slug", "my-second-folder"], ["updated_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00]]
|
552
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
553
|
+
|
554
|
+
|
555
|
+
Started GET "/admin/saphira/files" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
556
|
+
Processing by Saphira::FileItemsController#index as HTML
|
557
|
+
[1m[35mSaphira::FileItem Load (0.2ms)[0m SELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" IS NULL
|
558
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/index.html.erb within layouts/saphira/application (70.5ms)
|
559
|
+
Completed 200 OK in 73ms (Views: 71.7ms | ActiveRecord: 0.2ms)
|
560
|
+
|
561
|
+
|
562
|
+
Started DELETE "/admin/saphira/files/my-first-folder" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
563
|
+
Processing by Saphira::FileItemsController#destroy as HTML
|
564
|
+
Parameters: {"id"=>"my-first-folder"}
|
565
|
+
[1m[36mSaphira::FileItem Load (0.2ms)[0m [1mSELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."path" = 'my-first-folder' LIMIT 1[0m
|
566
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
567
|
+
[1m[36mSQL (0.1ms)[0m [1mDELETE FROM "saphira_file_items" WHERE ("lft" > 1 AND "rgt" < 2)[0m
|
568
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "saphira_file_items" SET "lft" = ("lft" - 2) WHERE "saphira_file_items"."id" IN (SELECT "saphira_file_items"."id" FROM "saphira_file_items" WHERE ("lft" > 2) ORDER BY "lft")
|
569
|
+
[1m[36mSQL (0.1ms)[0m [1mUPDATE "saphira_file_items" SET "rgt" = ("rgt" - 2) WHERE "saphira_file_items"."id" IN (SELECT "saphira_file_items"."id" FROM "saphira_file_items" WHERE ("rgt" > 2) ORDER BY "lft")[0m
|
570
|
+
[1m[35mActsAsTaggableOn::Tagging Load (0.1ms)[0m SELECT "taggings".* FROM "taggings" WHERE "taggings"."taggable_id" = 1 AND "taggings"."taggable_type" = 'Saphira::FileItem'
|
571
|
+
[1m[36mSQL (0.2ms)[0m [1mSELECT "taggings"."id" AS t0_r0, "taggings"."tag_id" AS t0_r1, "taggings"."taggable_id" AS t0_r2, "taggings"."taggable_type" AS t0_r3, "taggings"."tagger_id" AS t0_r4, "taggings"."tagger_type" AS t0_r5, "taggings"."context" AS t0_r6, "taggings"."created_at" AS t0_r7, "tags"."id" AS t1_r0, "tags"."name" AS t1_r1 FROM "taggings" LEFT OUTER JOIN "tags" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 1 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND (taggings.tag_id = tags.id AND taggings.context = 'tags')[0m
|
572
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "saphira_file_items" WHERE "saphira_file_items"."id" = ? [["id", 1]]
|
573
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
574
|
+
Redirected to http://www.example.com/admin/saphira/files
|
575
|
+
Completed 302 Found in 23ms
|
576
|
+
|
577
|
+
|
578
|
+
Started GET "/admin/saphira/files" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
579
|
+
Processing by Saphira::FileItemsController#index as HTML
|
580
|
+
[1m[35mSaphira::FileItem Load (0.2ms)[0m SELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" IS NULL
|
581
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/index.html.erb within layouts/saphira/application (4.9ms)
|
582
|
+
Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.2ms)
|
583
|
+
|
584
|
+
|
585
|
+
Started GET "/admin/saphira/files" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
586
|
+
Processing by Saphira::FileItemsController#index as HTML
|
587
|
+
[1m[36mSaphira::FileItem Load (0.2ms)[0m [1mSELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" IS NULL[0m
|
588
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/index.html.erb within layouts/saphira/application (1.3ms)
|
589
|
+
Completed 200 OK in 4ms (Views: 2.4ms | ActiveRecord: 0.2ms)
|
590
|
+
|
591
|
+
|
592
|
+
Started GET "/admin/saphira/files/new?type=file" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
593
|
+
Processing by Saphira::FileItemsController#new as HTML
|
594
|
+
Parameters: {"type"=>"file"}
|
595
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.2ms)[0m SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" IS NULL AND "taggings"."taggable_type" = 'Saphira::FileItem' AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)
|
596
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/_form.html.erb (5.0ms)
|
597
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/new_file.html.erb within layouts/saphira/application (6.3ms)
|
598
|
+
Completed 200 OK in 9ms (Views: 7.9ms | ActiveRecord: 0.2ms)
|
599
|
+
|
600
|
+
|
601
|
+
Started POST "/admin/saphira/files" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
602
|
+
Processing by Saphira::FileItemsController#create as HTML
|
603
|
+
Parameters: {"utf8"=>"✓", "file_item"=>{"name"=>"My first image", "file"=>#<ActionDispatch::Http::UploadedFile:0x000001009b3218 @original_filename="eos-550d-wrong-orientation.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"file_item[file]\"; filename=\"eos-550d-wrong-orientation.jpg\"\r\nContent-Type: image/jpeg\r\nContent-Length: 77008\r\n", @tempfile=#<File:/var/folders/j5/j5YeT6owHCOVwWrGfycQx++++TI/-Tmp-/RackMultipart20110906-51442-1oocr6l>>, "tag_list"=>"Trash, Orange, Berlin", "item_type"=>"file", "parent_id"=>""}, "commit"=>"Create"}
|
604
|
+
[1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m
|
605
|
+
[1m[35mSaphira::FileItem Load (0.3ms)[0m SELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."parent_id" IS NULL AND ("slug" = 'my-first-image' OR "slug" LIKE 'my-first-image--%') ORDER BY LENGTH("slug") DESC, "slug" DESC LIMIT 1
|
606
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "saphira_file_items" WHERE ("saphira_file_items"."name" = 'My first image' AND "saphira_file_items"."parent_id" IS NULL) LIMIT 1[0m
|
607
|
+
[1m[35m (0.4ms)[0m SELECT MAX("saphira_file_items"."rgt") AS max_id FROM "saphira_file_items"
|
608
|
+
[1m[36mSQL (1.4ms)[0m [1mINSERT INTO "saphira_file_items" ("created_at", "dynamic_attributes", "file_name", "file_uid", "item_type", "lft", "name", "parent_id", "path", "rgt", "slug", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00], ["dynamic_attributes", "--- \n:field_image_capture_date: 2011-08-26 14:04:10 +02:00\n:field_image_exposure_time: !ruby/object:Rational \n denominator: 40\n numerator: 1\n:field_image_f_number: !ruby/object:Rational \n denominator: 1\n numerator: 10\n:field_image_make: Canon\n:field_image_model: Canon EOS 550D\n:field_image_orientation: 8\n:field_image_orientation_transformed: true\n"], ["file_name", "eos-550d-wrong-orientation.jpg"], ["file_uid", "2011/09/06/17_27_54_786_eos_550d_wrong_orientation.jpg"], ["item_type", "file"], ["lft", 1], ["name", "My first image"], ["parent_id", nil], ["path", "my-first-image"], ["rgt", 2], ["slug", "my-first-image"], ["updated_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00]]
|
609
|
+
[1m[35mActsAsTaggableOn::Tag Load (0.2ms)[0m SELECT "tags".* FROM "tags" WHERE (name LIKE 'Trash' OR name LIKE 'Orange' OR name LIKE 'Berlin')
|
610
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "tags" WHERE "tags"."name" = 'Trash' LIMIT 1[0m
|
611
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "tags" ("name") VALUES (?) [["name", "Trash"]]
|
612
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "tags" WHERE "tags"."name" = 'Orange' LIMIT 1[0m
|
613
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "tags" ("name") VALUES (?) [["name", "Orange"]]
|
614
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "tags" WHERE "tags"."name" = 'Berlin' LIMIT 1[0m
|
615
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "tags" ("name") VALUES (?) [["name", "Berlin"]]
|
616
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.2ms)[0m [1mSELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 1 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)[0m
|
617
|
+
[1m[35mActsAsTaggableOn::Tagging Load (0.1ms)[0m SELECT "taggings".* FROM "taggings" WHERE "taggings"."taggable_id" = 1 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND "taggings"."tagger_type" IS NULL AND "taggings"."tagger_id" IS NULL AND "taggings"."context" = 'tags' AND "taggings"."tag_id" IN (NULL)
|
618
|
+
[1m[36m (0.2ms)[0m [1mSELECT 1 FROM "taggings" WHERE ("taggings"."tag_id" = 1 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND "taggings"."taggable_id" = 1 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1[0m
|
619
|
+
[1m[35mSQL (1.0ms)[0m INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type", "tagger_id", "tagger_type") VALUES (?, ?, ?, ?, ?, ?, ?) [["context", "tags"], ["created_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00], ["tag_id", 1], ["taggable_id", 1], ["taggable_type", "Saphira::FileItem"], ["tagger_id", nil], ["tagger_type", nil]]
|
620
|
+
[1m[36m (0.5ms)[0m [1mSELECT 1 FROM "taggings" WHERE ("taggings"."tag_id" = 2 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND "taggings"."taggable_id" = 1 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1[0m
|
621
|
+
[1m[35mSQL (0.8ms)[0m INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type", "tagger_id", "tagger_type") VALUES (?, ?, ?, ?, ?, ?, ?) [["context", "tags"], ["created_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00], ["tag_id", 2], ["taggable_id", 1], ["taggable_type", "Saphira::FileItem"], ["tagger_id", nil], ["tagger_type", nil]]
|
622
|
+
[1m[36m (0.2ms)[0m [1mSELECT 1 FROM "taggings" WHERE ("taggings"."tag_id" = 3 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND "taggings"."taggable_id" = 1 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1[0m
|
623
|
+
[1m[35mSQL (1.0ms)[0m INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type", "tagger_id", "tagger_type") VALUES (?, ?, ?, ?, ?, ?, ?) [["context", "tags"], ["created_at", Tue, 06 Sep 2011 15:27:54 UTC +00:00], ["tag_id", 3], ["taggable_id", 1], ["taggable_type", "Saphira::FileItem"], ["tagger_id", nil], ["tagger_type", nil]]
|
624
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
625
|
+
Redirected to http://www.example.com/admin/saphira/files/my-first-image
|
626
|
+
Completed 302 Found in 283ms
|
627
|
+
|
628
|
+
|
629
|
+
Started GET "/admin/saphira/files/my-first-image" for 127.0.0.1 at 2011-09-06 17:27:54 +0200
|
630
|
+
Processing by Saphira::FileItemsController#show as HTML
|
631
|
+
Parameters: {"id"=>"my-first-image"}
|
632
|
+
[1m[35mSaphira::FileItem Load (0.3ms)[0m SELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."path" = 'my-first-image' LIMIT 1
|
633
|
+
[1m[36mActsAsTaggableOn::Tag Load (0.2ms)[0m [1mSELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 1 AND "taggings"."taggable_type" = 'Saphira::FileItem' AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)[0m
|
634
|
+
[1m[35mSaphira::FileItem Load (0.2ms)[0m SELECT "saphira_file_items".* FROM "saphira_file_items" WHERE "saphira_file_items"."id" IS NULL LIMIT 1
|
635
|
+
Rendered /Users/spieker/Sites/gems-projects/saphira/app/views/saphira/file_items/show.html.erb within layouts/saphira/application (19.7ms)
|
636
|
+
Completed 200 OK in 25ms (Views: 22.0ms | ActiveRecord: 0.7ms)
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
{: nameI"#eos-550d-wrong-orientation.jpg:ET:model_classI"Saphira::FileItem;F:model_attachment: file
|
@@ -19,30 +19,30 @@ module Saphira
|
|
19
19
|
|
20
20
|
test "should create file_item" do
|
21
21
|
assert_difference('FileItem.count') do
|
22
|
-
post :create, file_item
|
22
|
+
post :create, :file_item => @file_item.attributes
|
23
23
|
end
|
24
24
|
|
25
25
|
assert_redirected_to file_item_path(assigns(:file_item))
|
26
26
|
end
|
27
27
|
|
28
28
|
test "should show file_item" do
|
29
|
-
get :show, id
|
29
|
+
get :show, :id => @file_item.to_param
|
30
30
|
assert_response :success
|
31
31
|
end
|
32
32
|
|
33
33
|
test "should get edit" do
|
34
|
-
get :edit, id
|
34
|
+
get :edit, :id => @file_item.to_param
|
35
35
|
assert_response :success
|
36
36
|
end
|
37
37
|
|
38
38
|
test "should update file_item" do
|
39
|
-
put :update, id
|
39
|
+
put :update, :id => @file_item.to_param, :file_item => @file_item.attributes
|
40
40
|
assert_redirected_to file_item_path(assigns(:file_item))
|
41
41
|
end
|
42
42
|
|
43
43
|
test "should destroy file_item" do
|
44
44
|
assert_difference('FileItem.count', -1) do
|
45
|
-
delete :destroy, id
|
45
|
+
delete :destroy, :id => @file_item.to_param
|
46
46
|
end
|
47
47
|
|
48
48
|
assert_redirected_to file_items_path
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: saphira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 0.1.0.
|
5
|
+
version: 0.1.0.beta3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Paul Spieker
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-09-
|
13
|
+
date: 2011-09-06 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -363,6 +363,8 @@ files:
|
|
363
363
|
- test/dummy/system/files/test/2011/09/04/20_14_52_22_eos_550d_wrong_orientation.jpg.meta
|
364
364
|
- test/dummy/system/files/test/2011/09/05/09_42_46_972_eos_550d_wrong_orientation.jpg
|
365
365
|
- test/dummy/system/files/test/2011/09/05/09_42_46_972_eos_550d_wrong_orientation.jpg.meta
|
366
|
+
- test/dummy/system/files/test/2011/09/06/17_27_54_786_eos_550d_wrong_orientation.jpg
|
367
|
+
- test/dummy/system/files/test/2011/09/06/17_27_54_786_eos_550d_wrong_orientation.jpg.meta
|
366
368
|
- test/dummy/tmp/cache/assets/C54/230/sprockets%2F63597bd80af49501176a9c782c200818
|
367
369
|
- test/dummy/tmp/cache/assets/C8A/C90/sprockets%2Fb0034d98e259fe21084231df778476e5
|
368
370
|
- test/dummy/tmp/cache/assets/CBB/220/sprockets%2Fe50398a56291b292932098dbaf6f60e7
|
@@ -476,6 +478,8 @@ test_files:
|
|
476
478
|
- test/dummy/system/files/test/2011/09/04/20_14_52_22_eos_550d_wrong_orientation.jpg.meta
|
477
479
|
- test/dummy/system/files/test/2011/09/05/09_42_46_972_eos_550d_wrong_orientation.jpg
|
478
480
|
- test/dummy/system/files/test/2011/09/05/09_42_46_972_eos_550d_wrong_orientation.jpg.meta
|
481
|
+
- test/dummy/system/files/test/2011/09/06/17_27_54_786_eos_550d_wrong_orientation.jpg
|
482
|
+
- test/dummy/system/files/test/2011/09/06/17_27_54_786_eos_550d_wrong_orientation.jpg.meta
|
479
483
|
- test/dummy/tmp/cache/assets/C54/230/sprockets%2F63597bd80af49501176a9c782c200818
|
480
484
|
- test/dummy/tmp/cache/assets/C8A/C90/sprockets%2Fb0034d98e259fe21084231df778476e5
|
481
485
|
- test/dummy/tmp/cache/assets/CBB/220/sprockets%2Fe50398a56291b292932098dbaf6f60e7
|