enju_event 0.1.19 → 0.2.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -3
  3. data/Rakefile +9 -15
  4. data/app/controllers/concerns/enju_event/controller.rb +13 -0
  5. data/app/controllers/event_categories_controller.rb +13 -2
  6. data/app/controllers/event_export_files_controller.rb +13 -3
  7. data/app/controllers/event_import_files_controller.rb +14 -4
  8. data/app/controllers/event_import_results_controller.rb +12 -1
  9. data/app/controllers/events_controller.rb +18 -8
  10. data/app/controllers/participates_controller.rb +11 -1
  11. data/app/controllers/places_controller.rb +64 -0
  12. data/app/jobs/event_export_file_job.rb +7 -0
  13. data/app/jobs/event_import_file_job.rb +7 -0
  14. data/app/models/event.rb +6 -5
  15. data/app/models/event_category.rb +3 -4
  16. data/app/models/event_export_file.rb +4 -5
  17. data/app/models/event_export_file_transition.rb +4 -4
  18. data/app/models/event_import_file.rb +8 -9
  19. data/app/models/event_import_file_transition.rb +4 -4
  20. data/app/models/event_import_result.rb +2 -3
  21. data/app/models/participate.rb +2 -3
  22. data/app/models/place.rb +18 -0
  23. data/app/policies/event_category_policy.rb +23 -0
  24. data/app/policies/event_export_file_policy.rb +21 -0
  25. data/app/policies/event_import_file_policy.rb +21 -0
  26. data/app/policies/event_import_result_policy.rb +21 -0
  27. data/app/policies/event_policy.rb +21 -0
  28. data/app/policies/participate_policy.rb +21 -0
  29. data/app/policies/place_policy.rb +21 -0
  30. data/app/views/event_categories/index.html.erb +4 -4
  31. data/app/views/event_categories/show.html.erb +1 -1
  32. data/app/views/events/_calendar.html.erb +1 -1
  33. data/app/views/events/{index.mobile.erb → index.html+phone.erb} +6 -6
  34. data/app/views/events/index.html.erb +11 -12
  35. data/app/views/events/index.rss.builder +2 -2
  36. data/app/views/events/{show.mobile.erb → show.html+phone.erb} +0 -0
  37. data/app/views/events/show.html.erb +2 -2
  38. data/app/views/picture_files/_index_event.html.erb +4 -4
  39. data/app/views/places/_form.html.erb +37 -0
  40. data/app/views/places/edit.html.erb +6 -0
  41. data/app/views/places/index.html.erb +35 -0
  42. data/app/views/places/new.html.erb +5 -0
  43. data/app/views/places/show.html.erb +29 -0
  44. data/config/routes.rb +1 -0
  45. data/db/migrate/20151128142913_create_places.rb +15 -0
  46. data/db/migrate/20151201163718_add_place_id_to_event.rb +6 -0
  47. data/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  48. data/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  49. data/lib/enju_event.rb +0 -19
  50. data/lib/enju_event/version.rb +1 -1
  51. data/lib/tasks/enju_event_tasks.rake +1 -1
  52. data/spec/controllers/event_categories_controller_spec.rb +58 -58
  53. data/spec/controllers/event_export_files_controller_spec.rb +6 -6
  54. data/spec/controllers/event_import_files_controller_spec.rb +4 -4
  55. data/spec/controllers/event_import_results_controller_spec.rb +2 -2
  56. data/spec/controllers/events_controller_spec.rb +6 -6
  57. data/spec/controllers/participates_controller_spec.rb +54 -54
  58. data/spec/dummy/app/controllers/application_controller.rb +8 -4
  59. data/spec/dummy/app/models/user.rb +2 -2
  60. data/spec/dummy/config/application.rb +5 -24
  61. data/spec/dummy/config/environments/development.rb +25 -14
  62. data/spec/dummy/config/environments/production.rb +50 -31
  63. data/spec/dummy/config/environments/test.rb +19 -14
  64. data/spec/dummy/config/routes.rb +3 -0
  65. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +14 -0
  66. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
  67. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
  68. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
  69. data/spec/dummy/db/schema.rb +52 -1
  70. data/spec/fixtures/event_categories.yml +3 -4
  71. data/spec/fixtures/event_export_files.yml +4 -4
  72. data/spec/fixtures/event_import_files.yml +8 -8
  73. data/spec/fixtures/event_import_results.yml +2 -3
  74. data/spec/fixtures/events.yml +7 -7
  75. data/spec/fixtures/participates.yml +2 -3
  76. data/spec/models/event_category_spec.rb +3 -4
  77. data/spec/models/event_export_file_spec.rb +5 -5
  78. data/spec/models/event_import_file_spec.rb +9 -9
  79. data/spec/models/event_import_result_spec.rb +2 -3
  80. data/spec/models/event_spec.rb +4 -3
  81. data/spec/models/participate_spec.rb +2 -3
  82. data/spec/support/devise.rb +2 -2
  83. metadata +132 -25
  84. data/app/models/enju_event/ability.rb +0 -43
  85. data/app/workers/event_export_file_queue.rb +0 -7
  86. data/app/workers/event_import_file_queue.rb +0 -7
  87. data/lib/enju_event/import_file.rb +0 -13
  88. data/spec/dummy/app/models/ability.rb +0 -41
@@ -1,43 +0,0 @@
1
- module EnjuEvent
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 [:read, :create, :update], EventCategory
9
- can [:destroy, :delete], EventCategory do |event_category|
10
- !['unknown', 'closed'].include?(event_category.name)
11
- end
12
- can :manage, [
13
- Event,
14
- EventImportFile,
15
- EventExportFile,
16
- Participate
17
- ]
18
- can :read, EventImportResult
19
- when 'Librarian'
20
- can :manage, [
21
- Event,
22
- EventImportFile,
23
- EventExportFile,
24
- Participate
25
- ]
26
- can :read, [
27
- EventCategory,
28
- EventImportResult
29
- ]
30
- when 'User'
31
- can :read, [
32
- Event,
33
- EventCategory
34
- ]
35
- else
36
- can :read, [
37
- Event,
38
- EventCategory
39
- ]
40
- end
41
- end
42
- end
43
- end
@@ -1,7 +0,0 @@
1
- class EventExportFileQueue
2
- @queue = :enju_leaf
3
-
4
- def self.perform(event_export_id)
5
- EventExportFile.find(event_export_id).export!
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- class EventImportFileQueue
2
- @queue = :enju_leaf
3
-
4
- def self.perform(event_import_file_id)
5
- EventImportFile.find(event_import_file_id).import_start
6
- end
7
- end
@@ -1,13 +0,0 @@
1
- module ImportFile
2
- def self.included(base)
3
- base.extend ClassMethods
4
- end
5
-
6
- module ClassMethods
7
- def expire
8
- self.stucked.find_each do |file|
9
- file.destroy
10
- end
11
- end
12
- end
13
- end
@@ -1,41 +0,0 @@
1
- #module EnjuEvent
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 [:read, :create], EventCategory
9
- can [:update, :destroy, :delete], EventCategory do |event_category|
10
- !['unknown', 'closed'].include?(event_category.name)
11
- end
12
- can :manage, [
13
- Event,
14
- EventImportFile,
15
- Participate
16
- ]
17
- can :read, EventImportResult
18
- when 'Librarian'
19
- can :manage, [
20
- Event,
21
- EventImportFile,
22
- Participate
23
- ]
24
- can :read, [
25
- EventCategory,
26
- EventImportResult
27
- ]
28
- when 'User'
29
- can :read, [
30
- Event,
31
- EventCategory
32
- ]
33
- else
34
- can :read, [
35
- Event,
36
- EventCategory
37
- ]
38
- end
39
- end
40
- end
41
- #end