enju_subject 0.1.1 → 0.2.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -3
  3. data/app/controllers/classification_types_controller.rb +13 -2
  4. data/app/controllers/classifications_controller.rb +12 -3
  5. data/app/controllers/concerns/enju_subject/controller.rb +27 -0
  6. data/app/controllers/subject_heading_types_controller.rb +13 -2
  7. data/app/controllers/subject_types_controller.rb +13 -2
  8. data/app/controllers/subjects_controller.rb +12 -4
  9. data/app/models/classification.rb +1 -1
  10. data/app/models/classification_type.rb +0 -1
  11. data/app/models/concerns/enju_subject/enju_manifestation.rb +37 -0
  12. data/app/models/subject.rb +1 -1
  13. data/app/models/subject_heading_type.rb +0 -1
  14. data/app/models/subject_type.rb +0 -1
  15. data/app/policies/classification_policy.rb +21 -0
  16. data/app/policies/classification_type_policy.rb +23 -0
  17. data/app/policies/subject_heading_type_policy.rb +23 -0
  18. data/app/policies/subject_policy.rb +21 -0
  19. data/app/policies/subject_type_policy.rb +21 -0
  20. data/app/views/classification_types/index.html.erb +4 -4
  21. data/app/views/classification_types/show.html.erb +2 -2
  22. data/app/views/classifications/index.html.erb +2 -2
  23. data/app/views/classifications/show.html.erb +2 -2
  24. data/app/views/manifestations/_classification_fields.html.erb +5 -0
  25. data/app/views/manifestations/_subject_facet.html.erb +2 -2
  26. data/app/views/manifestations/_subject_fields.html.erb +6 -0
  27. data/app/views/manifestations/_subject_form.html.erb +8 -9
  28. data/app/views/subject_heading_types/index.html.erb +4 -4
  29. data/app/views/subject_heading_types/show.html.erb +2 -2
  30. data/app/views/subject_types/index.html.erb +4 -4
  31. data/app/views/subject_types/show.html.erb +2 -2
  32. data/app/views/subjects/index.html.erb +3 -3
  33. data/app/views/subjects/index.rss.builder +2 -2
  34. data/app/views/subjects/show.html.erb +3 -3
  35. data/db/fixtures/subject_types.yml +4 -4
  36. data/lib/enju_subject/master_model.rb +3 -3
  37. data/lib/enju_subject/version.rb +1 -1
  38. data/lib/enju_subject.rb +0 -29
  39. data/lib/generators/enju_subject/setup/setup_generator.rb +6 -1
  40. data/lib/generators/enju_subject/setup/templates/db/fixtures/classification_types.yml +6 -0
  41. data/lib/generators/enju_subject/setup/templates/db/fixtures/subject_heading_types.yml +6 -6
  42. data/lib/tasks/enju_subject_tasks.rake +1 -1
  43. data/spec/controllers/classification_types_controller_spec.rb +13 -13
  44. data/spec/controllers/classifications_controller_spec.rb +9 -9
  45. data/spec/controllers/subject_heading_types_controller_spec.rb +58 -58
  46. data/spec/controllers/subject_types_controller_spec.rb +13 -13
  47. data/spec/controllers/subjects_controller_spec.rb +9 -9
  48. data/spec/dummy/app/controllers/application_controller.rb +8 -4
  49. data/spec/dummy/app/models/user.rb +1 -1
  50. data/spec/dummy/config/application.rb +5 -24
  51. data/spec/dummy/config/environments/development.rb +25 -14
  52. data/spec/dummy/config/environments/production.rb +50 -31
  53. data/spec/dummy/config/environments/test.rb +23 -18
  54. data/spec/dummy/config/initializers/enju_leaf.rb +1 -0
  55. data/spec/dummy/db/schema.rb +2 -1
  56. data/spec/lib/generators/enju_subject/setup/setup_generator_spec.rb +34 -0
  57. data/spec/support/devise.rb +2 -1
  58. metadata +95 -20
  59. data/app/models/enju_subject/ability.rb +0 -58
  60. data/lib/enju_subject/manifestation.rb +0 -44
  61. data/spec/dummy/app/models/ability.rb +0 -59
  62. data/spec/dummy/config/application.yml +0 -38
  63. data/spec/dummy/config/initializers/assets.rb +0 -12
@@ -1,59 +0,0 @@
1
- #module EnjuSubject
2
- class Ability
3
- include CanCan::Ability
4
-
5
- def initialize(user, ip_address = '0.0.0.0')
6
- case user.try(:role).try(:name)
7
- when 'Administrator'
8
- can :manage, [
9
- Classification,
10
- Subject
11
- ]
12
- if LibraryGroup.site_config.network_access_allowed?(ip_address)
13
- can [:read, :create, :update], ClassificationType
14
- can [:destroy, :delete], ClassificationType do |classification_type|
15
- classification_type.classifications.empty?
16
- end
17
- can :manage, [
18
- Classification,
19
- Subject,
20
- SubjectHeadingType,
21
- SubjectType
22
- ]
23
- else
24
- can :read, [
25
- ClassificationType,
26
- SubjectHeadingType,
27
- SubjectType
28
- ]
29
- end
30
- can :read, Manifestation
31
- when 'Librarian'
32
- can :read, [
33
- Classification,
34
- ClassificationType,
35
- Subject,
36
- SubjectType,
37
- SubjectHeadingType
38
- ]
39
- can :read, Manifestation
40
- when 'User'
41
- can :read, [
42
- Classification,
43
- ClassificationType,
44
- Subject,
45
- SubjectHeadingType
46
- ]
47
- can :read, Manifestation
48
- else
49
- can :read, [
50
- Classification,
51
- ClassificationType,
52
- Subject,
53
- SubjectHeadingType
54
- ]
55
- can :read, Manifestation
56
- end
57
- end
58
- end
59
- #end
@@ -1,38 +0,0 @@
1
- defaults: &defaults
2
- enju:
3
- web_hostname: localhost
4
- web_port_number: 3000
5
-
6
- family_name_first: true
7
- max_number_of_results: 500
8
- write_search_log_to_file: true
9
- csv_charset_conversion: true
10
-
11
- # Choose a locale from 'ca', 'de', 'fr', 'jp', 'uk', 'us'
12
- #AMAZON_AWS_HOSTNAME = 'ecs.amazonaws.com'
13
- amazon:
14
- aws_hostname: ecs.amazonaws.jp
15
- hostname: www.amazon.co.jp
16
- access_key: REPLACE_WITH_YOUR_AMAZON_ACCESS_KEY
17
- secret_access_key: REPLACE_WITH_YOUR_AMAZON_SECRET_ACCESS_KEY
18
-
19
- # :google, :amazon
20
- book_jacket:
21
- source: :google
22
- unknown_resource:
23
-
24
- # :mozshot, :simpleapi, :heartrails, :thumbalizr
25
- screenshot:
26
- generator: :mozshot
27
-
28
- uploaded_file:
29
- storage: :local
30
-
31
- development:
32
- <<: *defaults
33
-
34
- test:
35
- <<: *defaults
36
-
37
- production:
38
- <<: *defaults
@@ -1,12 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Version of your assets, change this if you want to expire all your assets.
4
- Rails.application.config.assets.version = '1.0'
5
-
6
- # Add additional assets to the asset load path
7
- # Rails.application.config.assets.paths << Emoji.images_path
8
-
9
- # Precompile additional assets.
10
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
- # Rails.application.config.assets.precompile += %w( search.js )
12
- Rails.application.config.assets.precompile += %w( *.png icons/*.png )