enju_bookmark 0.2.0.beta.2 → 0.2.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/bookmark.rb +3 -4
  3. data/app/models/bookmark_stat.rb +2 -3
  4. data/app/models/bookmark_stat_has_manifestation.rb +2 -3
  5. data/app/models/bookmark_stat_transition.rb +4 -4
  6. data/app/models/tag.rb +4 -4
  7. data/lib/enju_bookmark/version.rb +1 -1
  8. data/spec/dummy/app/models/user.rb +1 -1
  9. data/spec/dummy/config/application.rb +2 -0
  10. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  11. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +5 -0
  12. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +5 -0
  13. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +9 -0
  14. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +9 -0
  15. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +5 -0
  16. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +5 -0
  17. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +5 -0
  18. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +5 -0
  19. data/spec/dummy/db/schema.rb +15 -6
  20. data/spec/fixtures/bookmark_stat_has_manifestations.yml +2 -3
  21. data/spec/fixtures/bookmark_stats.yml +2 -2
  22. data/spec/fixtures/bookmarks.yml +3 -4
  23. data/spec/fixtures/library_groups.yml +1 -6
  24. data/spec/models/bookmark_spec.rb +3 -4
  25. data/spec/models/bookmark_stat_has_manifestation_spec.rb +2 -3
  26. data/spec/models/bookmark_stat_spec.rb +2 -2
  27. metadata +48 -6
  28. data/spec/dummy/app/models/ability.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 487ff118417cb4d67d7e145328937e9548da920d
4
- data.tar.gz: e63aa5cafde269a3a78755e27df5987aa32d7cac
3
+ metadata.gz: 190e7dbdc66ee197be07f3f623d8a7655c6cda09
4
+ data.tar.gz: 7756a42345b8db40bd1e87b546f369ef687c7d43
5
5
  SHA512:
6
- metadata.gz: d062fccaa0e70d84f44913b5016b50a19de84eef7f4673d7edf9b1ba458e98027543519eeb01efba3f61d47223e57581464595ff4c3d579a29b00fca08155e6d
7
- data.tar.gz: fda7463f3a155e5ff182fd6ac2d9b454503bc6eba3afc6c0cbdfd03f4c9c22af6eb7256be38d13eea342343344a2c3c79aaa819bdc3997a73d1afdbe7107c3cd
6
+ metadata.gz: aac0b75e0062e0ac74fe1439504642c574ed7bf862e9a50260d192782b74e6a6ffd271288a02b834a62ddfd00df13efcd93408b04fb0e5ad755efb4f2fbd49ad
7
+ data.tar.gz: 85318d980248618a1cf08492dc88c4a233f920a607a2bec301db300b27aebfb02725dba2332ff81163d5b1c1f5d1ac4eeade169f084dd437e09720830977c673
@@ -191,10 +191,9 @@ end
191
191
  # user_id :integer not null
192
192
  # manifestation_id :integer
193
193
  # title :text
194
- # url :string(255)
194
+ # url :string
195
195
  # note :text
196
196
  # shared :boolean
197
- # created_at :datetime not null
198
- # updated_at :datetime not null
197
+ # created_at :datetime
198
+ # updated_at :datetime
199
199
  #
200
-
@@ -54,7 +54,6 @@ end
54
54
  # started_at :datetime
55
55
  # completed_at :datetime
56
56
  # note :text
57
- # created_at :datetime not null
58
- # updated_at :datetime not null
57
+ # created_at :datetime
58
+ # updated_at :datetime
59
59
  #
60
-
@@ -16,7 +16,6 @@ end
16
16
  # bookmark_stat_id :integer not null
17
17
  # manifestation_id :integer not null
18
18
  # bookmarks_count :integer
19
- # created_at :datetime not null
20
- # updated_at :datetime not null
19
+ # created_at :datetime
20
+ # updated_at :datetime
21
21
  #
22
-
@@ -11,10 +11,10 @@ end
11
11
  # Table name: bookmark_stat_transitions
12
12
  #
13
13
  # id :integer not null, primary key
14
- # to_state :string(255)
15
- # metadata :text default("{}")
14
+ # to_state :string
15
+ # metadata :text default({})
16
16
  # sort_key :integer
17
17
  # bookmark_stat_id :integer
18
- # created_at :datetime not null
19
- # updated_at :datetime not null
18
+ # created_at :datetime
19
+ # updated_at :datetime
20
20
  #
data/app/models/tag.rb CHANGED
@@ -48,9 +48,9 @@ end
48
48
  # Table name: tags
49
49
  #
50
50
  # id :integer not null, primary key
51
- # name :string(255)
52
- # name_transcription :string(255)
53
- # created_at :datetime not null
54
- # updated_at :datetime not null
51
+ # name :string
52
+ # name_transcription :string
53
+ # created_at :datetime
54
+ # updated_at :datetime
55
55
  # taggings_count :integer default(0)
56
56
  #
@@ -1,3 +1,3 @@
1
1
  module EnjuBookmark
2
- VERSION = "0.2.0.beta.2"
2
+ VERSION = "0.2.0.beta.3"
3
3
  end
@@ -4,6 +4,6 @@ class User < ActiveRecord::Base
4
4
  :recoverable, :rememberable, :trackable, #, :validatable
5
5
  :lockable, :lock_strategy => :none, :unlock_strategy => :none
6
6
 
7
- include EnjuLeaf::EnjuUser
7
+ include EnjuSeed::EnjuUser
8
8
  include EnjuBookmark::EnjuUser
9
9
  end
@@ -5,6 +5,8 @@ require 'rails/all'
5
5
  Bundler.require(*Rails.groups)
6
6
  require 'enju_bookmark'
7
7
  require 'enju_leaf'
8
+ require 'globalize'
9
+ require 'globalize-accessors'
8
10
 
9
11
  module Dummy
10
12
  class Application < Rails::Application
@@ -6,7 +6,7 @@ class CreateUserImportFiles < ActiveRecord::Migration
6
6
  t.datetime :executed_at
7
7
  t.string :user_import_file_name
8
8
  t.string :user_import_content_type
9
- t.string :user_import_file_size
9
+ t.integer :user_import_file_size
10
10
  t.datetime :user_import_updated_at
11
11
  t.string :user_import_fingerprint
12
12
  t.string :edit_mode
@@ -0,0 +1,5 @@
1
+ class AddErrorMessageToUserImportResult < ActiveRecord::Migration
2
+ def change
3
+ add_column :user_import_results, :error_message, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddHtmlSnippetToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :html_snippet, :text
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToUserImportFileTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :user_import_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :user_import_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToUserExportFileTransitions < ActiveRecord::Migration
2
+ def up
3
+ add_column :user_export_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :user_export_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddMaxNumberOfResultsToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :max_number_of_results, :integer, default: 500
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFamilyNameFirstToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :family_name_first, :boolean, default: true
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPubYearFacetRangeIntervalToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_column :library_groups, :pub_year_facet_range_interval, :integer, default: 10
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddUserIdToLibraryGroup < ActiveRecord::Migration
2
+ def change
3
+ add_reference :library_groups, :user, index: true, foreign_key: true
4
+ end
5
+ end
@@ -11,7 +11,7 @@
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: 20151213072705) do
14
+ ActiveRecord::Schema.define(version: 20160813203039) do
15
15
 
16
16
  create_table "accepts", force: :cascade do |t|
17
17
  t.integer "basket_id"
@@ -693,9 +693,9 @@ ActiveRecord::Schema.define(version: 20151213072705) do
693
693
  add_index "library_group_translations", ["locale"], name: "index_library_group_translations_on_locale"
694
694
 
695
695
  create_table "library_groups", force: :cascade do |t|
696
- t.string "name", null: false
696
+ t.string "name", null: false
697
697
  t.text "display_name"
698
- t.string "short_name", null: false
698
+ t.string "short_name", null: false
699
699
  t.text "my_networks"
700
700
  t.text "login_banner"
701
701
  t.text "note"
@@ -704,12 +704,18 @@ ActiveRecord::Schema.define(version: 20151213072705) do
704
704
  t.datetime "created_at"
705
705
  t.datetime "updated_at"
706
706
  t.text "admin_networks"
707
- t.boolean "allow_bookmark_external_url", default: false, null: false
708
- t.string "url", default: "http://localhost:3000/"
707
+ t.boolean "allow_bookmark_external_url", default: false, null: false
708
+ t.string "url", default: "http://localhost:3000/"
709
709
  t.text "settings"
710
+ t.text "html_snippet"
711
+ t.integer "max_number_of_results", default: 500
712
+ t.boolean "family_name_first", default: true
713
+ t.integer "pub_year_facet_range_interval", default: 10
714
+ t.integer "user_id"
710
715
  end
711
716
 
712
717
  add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
718
+ add_index "library_groups", ["user_id"], name: "index_library_groups_on_user_id"
713
719
 
714
720
  create_table "licenses", force: :cascade do |t|
715
721
  t.string "name", null: false
@@ -1413,6 +1419,7 @@ ActiveRecord::Schema.define(version: 20151213072705) do
1413
1419
  t.integer "user_export_file_id"
1414
1420
  t.datetime "created_at"
1415
1421
  t.datetime "updated_at"
1422
+ t.boolean "most_recent"
1416
1423
  end
1417
1424
 
1418
1425
  add_index "user_export_file_transitions", ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
@@ -1481,6 +1488,7 @@ ActiveRecord::Schema.define(version: 20151213072705) do
1481
1488
  t.integer "user_import_file_id"
1482
1489
  t.datetime "created_at"
1483
1490
  t.datetime "updated_at"
1491
+ t.boolean "most_recent"
1484
1492
  end
1485
1493
 
1486
1494
  add_index "user_import_file_transitions", ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
@@ -1492,7 +1500,7 @@ ActiveRecord::Schema.define(version: 20151213072705) do
1492
1500
  t.datetime "executed_at"
1493
1501
  t.string "user_import_file_name"
1494
1502
  t.string "user_import_content_type"
1495
- t.string "user_import_file_size"
1503
+ t.integer "user_import_file_size"
1496
1504
  t.datetime "user_import_updated_at"
1497
1505
  t.string "user_import_fingerprint"
1498
1506
  t.string "edit_mode"
@@ -1510,6 +1518,7 @@ ActiveRecord::Schema.define(version: 20151213072705) do
1510
1518
  t.text "body"
1511
1519
  t.datetime "created_at"
1512
1520
  t.datetime "updated_at"
1521
+ t.text "error_message"
1513
1522
  end
1514
1523
 
1515
1524
  create_table "user_reserve_stat_transitions", force: :cascade do |t|
@@ -18,7 +18,6 @@ two:
18
18
  # bookmark_stat_id :integer not null
19
19
  # manifestation_id :integer not null
20
20
  # bookmarks_count :integer
21
- # created_at :datetime not null
22
- # updated_at :datetime not null
21
+ # created_at :datetime
22
+ # updated_at :datetime
23
23
  #
24
-
@@ -22,6 +22,6 @@ bookmark_stat_00002:
22
22
  # started_at :datetime
23
23
  # completed_at :datetime
24
24
  # note :text
25
- # created_at :datetime not null
26
- # updated_at :datetime not null
25
+ # created_at :datetime
26
+ # updated_at :datetime
27
27
  #
@@ -50,10 +50,9 @@ bookmark_00005:
50
50
  # user_id :integer not null
51
51
  # manifestation_id :integer
52
52
  # title :text
53
- # url :string(255)
53
+ # url :string
54
54
  # note :text
55
55
  # shared :boolean
56
- # created_at :datetime not null
57
- # updated_at :datetime not null
56
+ # created_at :datetime
57
+ # updated_at :datetime
58
58
  #
59
-
@@ -8,12 +8,7 @@ one:
8
8
  my_networks: 0.0.0.0/0
9
9
  url: "http://localhost:3000/"
10
10
  admin_networks: 0.0.0.0/0
11
- settings: <% if Rails::VERSION::MAJOR > 3 %>
12
- "{\"max_number_of_results\":200,\"family_name_first\":true,\"book_jacket_source\":\"google\",\"screenshot_generator\":\"mozshot\"}"
13
- <% else %>
14
- "---\n:max_number_of_results: 200\n:family_name_first: true\n:book_jacket_source: \"google\"\n:screenshot_generator: \"mozshot\""
15
- <% end %>
16
-
11
+ user_id: 1
17
12
 
18
13
  # == Schema Information
19
14
  #
@@ -48,10 +48,9 @@ end
48
48
  # user_id :integer not null
49
49
  # manifestation_id :integer
50
50
  # title :text
51
- # url :string(255)
51
+ # url :string
52
52
  # note :text
53
53
  # shared :boolean
54
- # created_at :datetime not null
55
- # updated_at :datetime not null
54
+ # created_at :datetime
55
+ # updated_at :datetime
56
56
  #
57
-
@@ -14,7 +14,6 @@ end
14
14
  # bookmark_stat_id :integer not null
15
15
  # manifestation_id :integer not null
16
16
  # bookmarks_count :integer
17
- # created_at :datetime not null
18
- # updated_at :datetime not null
17
+ # created_at :datetime
18
+ # updated_at :datetime
19
19
  #
20
-
@@ -19,6 +19,6 @@ end
19
19
  # started_at :datetime
20
20
  # completed_at :datetime
21
21
  # note :text
22
- # created_at :datetime not null
23
- # updated_at :datetime not null
22
+ # created_at :datetime
23
+ # updated_at :datetime
24
24
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_bookmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta.2
4
+ version: 0.2.0.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_biblio
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0.beta.2
19
+ version: 0.2.0.beta.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0.beta.2
26
+ version: 0.2.0.beta.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: acts-as-taggable-on
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.2.0.beta.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: globalize
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: globalize-accessors
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: sqlite3
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -272,7 +300,6 @@ files:
272
300
  - spec/dummy/app/assets/stylesheets/application.css
273
301
  - spec/dummy/app/controllers/application_controller.rb
274
302
  - spec/dummy/app/helpers/application_helper.rb
275
- - spec/dummy/app/models/ability.rb
276
303
  - spec/dummy/app/models/user.rb
277
304
  - spec/dummy/app/views/layouts/application.html.erb
278
305
  - spec/dummy/bin/bundle
@@ -497,9 +524,17 @@ files:
497
524
  - spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb
498
525
  - spec/dummy/db/migrate/20150124152756_add_foreign_key_to_shelves_referencing_libraries.rb
499
526
  - spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb
527
+ - spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb
500
528
  - spec/dummy/db/migrate/20150924115059_create_withdraws.rb
501
529
  - spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb
502
530
  - spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb
531
+ - spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb
532
+ - spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb
533
+ - spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb
534
+ - spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb
535
+ - spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb
536
+ - spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb
537
+ - spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb
503
538
  - spec/dummy/db/schema.rb
504
539
  - spec/dummy/public/404.html
505
540
  - spec/dummy/public/422.html
@@ -576,7 +611,6 @@ test_files:
576
611
  - spec/dummy/app/assets/stylesheets/application.css
577
612
  - spec/dummy/app/controllers/application_controller.rb
578
613
  - spec/dummy/app/helpers/application_helper.rb
579
- - spec/dummy/app/models/ability.rb
580
614
  - spec/dummy/app/models/user.rb
581
615
  - spec/dummy/app/views/layouts/application.html.erb
582
616
  - spec/dummy/bin/bundle
@@ -801,9 +835,17 @@ test_files:
801
835
  - spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb
802
836
  - spec/dummy/db/migrate/20150124152756_add_foreign_key_to_shelves_referencing_libraries.rb
803
837
  - spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb
838
+ - spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb
804
839
  - spec/dummy/db/migrate/20150924115059_create_withdraws.rb
805
840
  - spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb
806
841
  - spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb
842
+ - spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb
843
+ - spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb
844
+ - spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb
845
+ - spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb
846
+ - spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb
847
+ - spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb
848
+ - spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb
807
849
  - spec/dummy/db/schema.rb
808
850
  - spec/dummy/public/404.html
809
851
  - spec/dummy/public/422.html
@@ -1,43 +0,0 @@
1
- #module EnjuBookmark
2
- class Ability
3
- include CanCan::Ability
4
-
5
- def initialize(user, ip_address = nil)
6
- case user.try(:role).try(:name)
7
- when 'Administrator'
8
- can :manage, [
9
- Bookmark,
10
- BookmarkStat,
11
- BookmarkStatHasManifestation,
12
- Tag
13
- ]
14
- when 'Librarian'
15
- can [:read, :create, :update], BookmarkStat
16
- can :read, BookmarkStatHasManifestation
17
- can :manage, [
18
- Bookmark,
19
- Tag
20
- ]
21
- when 'User'
22
- can [:index, :create], Bookmark
23
- can :show, Bookmark do |bookmark|
24
- if bookmark.user == user
25
- true
26
- elsif user.share_bookmarks
27
- true
28
- else
29
- false
30
- end
31
- end
32
- can [:update, :destroy, :delete], Bookmark do |bookmark|
33
- bookmark.user == user
34
- end
35
- can :read, BookmarkStat
36
- can :read, Tag
37
- else
38
- can :read, BookmarkStat
39
- can :read, Tag
40
- end
41
- end
42
- end
43
- #end