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.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/Rakefile +9 -15
- data/app/controllers/concerns/enju_event/controller.rb +13 -0
- data/app/controllers/event_categories_controller.rb +13 -2
- data/app/controllers/event_export_files_controller.rb +13 -3
- data/app/controllers/event_import_files_controller.rb +14 -4
- data/app/controllers/event_import_results_controller.rb +12 -1
- data/app/controllers/events_controller.rb +18 -8
- data/app/controllers/participates_controller.rb +11 -1
- data/app/controllers/places_controller.rb +64 -0
- data/app/jobs/event_export_file_job.rb +7 -0
- data/app/jobs/event_import_file_job.rb +7 -0
- data/app/models/event.rb +6 -5
- data/app/models/event_category.rb +3 -4
- data/app/models/event_export_file.rb +4 -5
- data/app/models/event_export_file_transition.rb +4 -4
- data/app/models/event_import_file.rb +8 -9
- data/app/models/event_import_file_transition.rb +4 -4
- data/app/models/event_import_result.rb +2 -3
- data/app/models/participate.rb +2 -3
- data/app/models/place.rb +18 -0
- data/app/policies/event_category_policy.rb +23 -0
- data/app/policies/event_export_file_policy.rb +21 -0
- data/app/policies/event_import_file_policy.rb +21 -0
- data/app/policies/event_import_result_policy.rb +21 -0
- data/app/policies/event_policy.rb +21 -0
- data/app/policies/participate_policy.rb +21 -0
- data/app/policies/place_policy.rb +21 -0
- data/app/views/event_categories/index.html.erb +4 -4
- data/app/views/event_categories/show.html.erb +1 -1
- data/app/views/events/_calendar.html.erb +1 -1
- data/app/views/events/{index.mobile.erb → index.html+phone.erb} +6 -6
- data/app/views/events/index.html.erb +11 -12
- data/app/views/events/index.rss.builder +2 -2
- data/app/views/events/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/events/show.html.erb +2 -2
- data/app/views/picture_files/_index_event.html.erb +4 -4
- data/app/views/places/_form.html.erb +37 -0
- data/app/views/places/edit.html.erb +6 -0
- data/app/views/places/index.html.erb +35 -0
- data/app/views/places/new.html.erb +5 -0
- data/app/views/places/show.html.erb +29 -0
- data/config/routes.rb +1 -0
- data/db/migrate/20151128142913_create_places.rb +15 -0
- data/db/migrate/20151201163718_add_place_id_to_event.rb +6 -0
- data/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
- data/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
- data/lib/enju_event.rb +0 -19
- data/lib/enju_event/version.rb +1 -1
- data/lib/tasks/enju_event_tasks.rake +1 -1
- data/spec/controllers/event_categories_controller_spec.rb +58 -58
- data/spec/controllers/event_export_files_controller_spec.rb +6 -6
- data/spec/controllers/event_import_files_controller_spec.rb +4 -4
- data/spec/controllers/event_import_results_controller_spec.rb +2 -2
- data/spec/controllers/events_controller_spec.rb +6 -6
- data/spec/controllers/participates_controller_spec.rb +54 -54
- data/spec/dummy/app/controllers/application_controller.rb +8 -4
- data/spec/dummy/app/models/user.rb +2 -2
- data/spec/dummy/config/application.rb +5 -24
- data/spec/dummy/config/environments/development.rb +25 -14
- data/spec/dummy/config/environments/production.rb +50 -31
- data/spec/dummy/config/environments/test.rb +19 -14
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/migrate/20140821151023_create_colors.rb +14 -0
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
- data/spec/dummy/db/schema.rb +52 -1
- data/spec/fixtures/event_categories.yml +3 -4
- data/spec/fixtures/event_export_files.yml +4 -4
- data/spec/fixtures/event_import_files.yml +8 -8
- data/spec/fixtures/event_import_results.yml +2 -3
- data/spec/fixtures/events.yml +7 -7
- data/spec/fixtures/participates.yml +2 -3
- data/spec/models/event_category_spec.rb +3 -4
- data/spec/models/event_export_file_spec.rb +5 -5
- data/spec/models/event_import_file_spec.rb +9 -9
- data/spec/models/event_import_result_spec.rb +2 -3
- data/spec/models/event_spec.rb +4 -3
- data/spec/models/participate_spec.rb +2 -3
- data/spec/support/devise.rb +2 -2
- metadata +132 -25
- data/app/models/enju_event/ability.rb +0 -43
- data/app/workers/event_export_file_queue.rb +0 -7
- data/app/workers/event_import_file_queue.rb +0 -7
- data/lib/enju_event/import_file.rb +0 -13
- 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,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
|