erp_tech_svcs 4.0.0 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -24
  3. data/app/controllers/api/v1/audit_log_items_controller.rb +33 -0
  4. data/app/controllers/api/v1/audit_logs_controller.rb +32 -0
  5. data/app/controllers/api/v1/capabilities_controller.rb +160 -0
  6. data/app/controllers/api/v1/file_assets_controller.rb +40 -0
  7. data/app/controllers/api/v1/groups_controller.rb +236 -0
  8. data/app/controllers/api/v1/security_roles_controller.rb +276 -0
  9. data/app/controllers/api/v1/users_controller.rb +262 -0
  10. data/app/controllers/erp_tech_svcs/session_controller.rb +8 -5
  11. data/app/controllers/erp_tech_svcs/user_controller.rb +14 -15
  12. data/app/mailers/user_mailer.rb +8 -5
  13. data/app/models/audit_log.rb +111 -36
  14. data/app/models/audit_log_item.rb +30 -0
  15. data/app/models/audit_log_item_type.rb +1 -0
  16. data/app/models/audit_log_type.rb +19 -0
  17. data/app/models/capability.rb +22 -6
  18. data/app/models/extensions/tracked_status_type.rb +3 -0
  19. data/app/models/file_asset.rb +245 -20
  20. data/app/models/file_asset_holder.rb +20 -0
  21. data/app/models/group.rb +38 -25
  22. data/app/models/notification.rb +32 -13
  23. data/app/models/notification_type.rb +13 -0
  24. data/app/models/security_role.rb +17 -4
  25. data/app/models/user.rb +116 -29
  26. data/app/validators/password_strength_validator.rb +1 -1
  27. data/app/views/user_mailer/activation_needed_email.html.erb +293 -15
  28. data/app/views/user_mailer/reset_password_email.html.erb +268 -13
  29. data/config/initializers/logger.rb +19 -0
  30. data/config/initializers/sorcery.rb +2 -0
  31. data/config/initializers/wickedpdf.rb +4 -0
  32. data/config/routes.rb +64 -0
  33. data/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.rb +1 -5
  34. data/db/data_migrations/20150819140550_create_job_tracker_for_notification.rb +14 -0
  35. data/db/migrate/20080805000010_base_tech_services.rb +99 -39
  36. data/db/migrate/20150414151421_add_nested_set_columns_to_security_role.rb +13 -0
  37. data/db/migrate/20150609003216_update_user_for_sorcery.rb +11 -0
  38. data/db/migrate/20150819135108_add_custom_fields_to_notifications.rb +5 -0
  39. data/db/migrate/20160122155402_add_description_to_file_asset.rb +13 -0
  40. data/db/migrate/20160310163060_add_created_by_updated_by_to_erp_tech_svcs.rb +35 -0
  41. data/db/migrate/20160313161611_add_tenant_id_to_audit_log.rb +16 -0
  42. data/lib/erp_tech_svcs.rb +6 -10
  43. data/lib/erp_tech_svcs/config.rb +7 -2
  44. data/lib/erp_tech_svcs/delayed_jobs/delete_expired_sessions_job.rb +49 -0
  45. data/lib/erp_tech_svcs/delayed_jobs/notification_job.rb +50 -0
  46. data/lib/erp_tech_svcs/engine.rb +0 -1
  47. data/lib/erp_tech_svcs/erp_tech_svcs_audit_log.rb +12 -6
  48. data/lib/erp_tech_svcs/extensions.rb +0 -1
  49. data/lib/erp_tech_svcs/extensions/active_record/has_capability_accessors.rb +57 -29
  50. data/lib/erp_tech_svcs/extensions/active_record/has_file_assets.rb +57 -31
  51. data/lib/erp_tech_svcs/extensions/active_record/has_security_roles.rb +12 -4
  52. data/lib/erp_tech_svcs/extensions/active_record/is_json.rb +22 -15
  53. data/lib/erp_tech_svcs/extensions/active_record/scoped_by.rb +16 -13
  54. data/lib/erp_tech_svcs/extensions/compass_ae/erp_base_erp_svcs/controllers/api/parties_controller.rb +15 -0
  55. data/lib/erp_tech_svcs/file_support.rb +1 -0
  56. data/lib/erp_tech_svcs/file_support/file_system_manager.rb +77 -44
  57. data/lib/erp_tech_svcs/file_support/manager.rb +12 -3
  58. data/lib/erp_tech_svcs/file_support/railties/compass_ae_resolver.rb +49 -0
  59. data/lib/erp_tech_svcs/file_support/s3_manager.rb +73 -51
  60. data/lib/erp_tech_svcs/utils/compass_access_negotiator.rb +11 -2
  61. data/lib/erp_tech_svcs/utils/default_nested_set_methods.rb +238 -46
  62. data/lib/erp_tech_svcs/version.rb +1 -1
  63. data/lib/tasks/erp_tech_svcs_tasks.rake +43 -5
  64. metadata +73 -42
  65. data/app/models/user_defined_data.rb +0 -6
  66. data/app/models/user_defined_field.rb +0 -8
  67. data/config/initializers/pdfkit.rb +0 -18
  68. data/db/data_migrations/20121130212146_note_capabilities.rb +0 -23
  69. data/db/migrate/20121116151510_create_groups.rb +0 -18
  70. data/db/migrate/20121126171612_upgrade_security.rb +0 -53
  71. data/db/migrate/20121126173506_upgrade_security2.rb +0 -274
  72. data/db/migrate/20130410135419_add_queue_to_delayed_jobs.rb +0 -13
  73. data/db/migrate/20130610163240_create_notifications.rb +0 -37
  74. data/db/migrate/20130725212647_add_party_id_idx_to_users.rb +0 -9
  75. data/db/migrate/20131113213843_add_audit_log_item_old_value.rb +0 -13
  76. data/db/migrate/20131113213844_add_erp_tech_svcs_missing_indexes.rb +0 -31
  77. data/db/migrate/20131129203603_add_user_defined_fields.rb +0 -43
  78. data/db/migrate/20141013060204_add_custom_fields_to_notifications.rb +0 -12
  79. data/db/migrate/20141108182427_add_scoped_by_to_file_assets.rb +0 -14
  80. data/lib/erp_tech_svcs/extensions/active_record/has_user_defined_data.rb +0 -147
  81. data/lib/erp_tech_svcs/sessions/delete_expired_sessions_job.rb +0 -47
  82. data/lib/erp_tech_svcs/sessions/delete_expired_sessions_service.rb +0 -15
  83. data/lib/erp_tech_svcs/utils/compass_logger.rb +0 -87
@@ -1,7 +1,7 @@
1
1
  module ErpTechSvcs
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 4
4
- MINOR = 0
4
+ MINOR = 2
5
5
  TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
@@ -4,19 +4,20 @@ namespace :erp_tech_svcs do
4
4
 
5
5
  desc "Sync storage between database and storage location ie (s3 or file system), taskes storage option"
6
6
  task :sync_storage, [:storage] => :environment do |t, args|
7
+ ErpTechSvcs::FileSupport::S3Manager.setup_connection
7
8
  file_support = ErpTechSvcs::FileSupport::Base.new(:storage => args.storage.to_sym)
8
9
 
9
10
  #sync shared
10
11
  puts "Syncing Shared Assets..."
11
- file_support.sync(File.join(file_support.root, '/images'), CompassAeInstance.find_by_internal_identifier('base'))
12
- file_support.sync(File.join(file_support.root, '/files'), CompassAeInstance.find_by_internal_identifier('base'))
12
+ file_support.sync(File.join(file_support.root, 'public/knitkit/images/'), CompassAeInstance.find_by_internal_identifier('base'))
13
+ file_support.sync(File.join(file_support.root, 'file_assets/shared_site_files/'), CompassAeInstance.find_by_internal_identifier('base'))
13
14
  puts "Complete"
14
15
 
15
16
  #sync websites
16
17
  puts "Syncing Websites..."
17
18
  Website.all.each do |website|
18
- file_support.sync(File.join(file_support.root, "/sites/site-#{website.id}/images"), website)
19
- file_support.sync(File.join(file_support.root, "/sites/site-#{website.id}/files"), website)
19
+ file_support.sync(File.join(file_support.root, "public/knitkit/sites/#{website.iid}/images"), website)
20
+ file_support.sync(File.join(file_support.root, "file_assets/sites/#{website.iid}"), website)
20
21
  end
21
22
  puts "Complete"
22
23
 
@@ -55,7 +56,44 @@ namespace :erp_tech_svcs do
55
56
 
56
57
  end
57
58
 
59
+ task :build_add_index_for_missing_index => :environment do
60
+
61
+ connection = ActiveRecord::Base.connection
62
+ connection.tables.collect do |table|
63
+ columns = connection.columns(table).collect(&:name).select { |x| x.ends_with?("_id" || x.ends_with("_type")) || x == 'internal_identifier' }
64
+ indexed_columns = connection.indexes(table).collect(&:columns).flatten.uniq
65
+ unindexed = columns - indexed_columns
66
+ unless unindexed.empty?
67
+ unindexed.each do |column|
68
+ name = "#{table}_#{column}_idx"
69
+
70
+ puts "add_index :#{table}, :#{column}, :name => '#{name}'"
71
+
72
+ end
73
+ end
74
+ end
75
+
76
+ end
77
+
78
+ task :build_remove_index_for_missing_index => :environment do
79
+
80
+ connection = ActiveRecord::Base.connection
81
+ connection.tables.collect do |table|
82
+ columns = connection.columns(table).collect(&:name).select { |x| x.ends_with?("_id" || x.ends_with("_type")) || x == 'internal_identifier' }
83
+ indexed_columns = connection.indexes(table).collect(&:columns).flatten.uniq
84
+ unindexed = columns - indexed_columns
85
+ unless unindexed.empty?
86
+ unindexed.each do |column|
87
+ name = "#{table}_#{column}_idx"
88
+
89
+ puts "remove_index :#{table}, :#{column}, :name => '#{name}'"
90
+
91
+ end
92
+ end
93
+ end
94
+
95
+ end
96
+
58
97
  end
59
98
 
60
99
  end
61
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_tech_svcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Koloski, Russell Holmes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-19 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erp_base_erp_svcs
@@ -16,70 +16,84 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '4.2'
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: '4.0'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: erp_dev_svcs
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '4.0'
33
+ version: '4.2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '4.0'
40
+ version: '4.2'
41
41
  - !ruby/object:Gem::Dependency
42
- name: chronic
42
+ name: encryptor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.10.2
47
+ version: 1.3.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.10.2
54
+ version: 1.3.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: aasm
56
+ name: attr_encrypted
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 3.0.14
61
+ version: 1.3.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 3.0.14
68
+ version: 1.3.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: chronic
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 0.10.2
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 0.10.2
69
83
  - !ruby/object:Gem::Dependency
70
- name: activerecord-postgres-hstore
84
+ name: aasm
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - '='
74
88
  - !ruby/object:Gem::Version
75
- version: 0.7.7
89
+ version: 3.0.14
76
90
  type: :runtime
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - '='
81
95
  - !ruby/object:Gem::Version
82
- version: 0.7.7
96
+ version: 3.0.14
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: nested-hstore
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +128,14 @@ dependencies:
114
128
  requirements:
115
129
  - - '='
116
130
  - !ruby/object:Gem::Version
117
- version: 1.35.0
131
+ version: 1.63.0
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
136
  - - '='
123
137
  - !ruby/object:Gem::Version
124
- version: 1.35.0
138
+ version: 1.63.0
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: delayed_job_active_record
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -151,33 +165,47 @@ dependencies:
151
165
  - !ruby/object:Gem::Version
152
166
  version: 3.3.1
153
167
  - !ruby/object:Gem::Dependency
154
- name: pdfkit
168
+ name: wicked_pdf
155
169
  requirement: !ruby/object:Gem::Requirement
156
170
  requirements:
157
171
  - - '='
158
172
  - !ruby/object:Gem::Version
159
- version: 0.5.2
173
+ version: 0.11.0
160
174
  type: :runtime
161
175
  prerelease: false
162
176
  version_requirements: !ruby/object:Gem::Requirement
163
177
  requirements:
164
178
  - - '='
165
179
  - !ruby/object:Gem::Version
166
- version: 0.5.2
180
+ version: 0.11.0
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: sorcery
169
183
  requirement: !ruby/object:Gem::Requirement
170
184
  requirements:
171
185
  - - '='
172
186
  - !ruby/object:Gem::Version
173
- version: 0.7.13
187
+ version: 0.9.1
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '='
193
+ - !ruby/object:Gem::Version
194
+ version: 0.9.1
195
+ - !ruby/object:Gem::Dependency
196
+ name: daemons
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - '='
200
+ - !ruby/object:Gem::Version
201
+ version: 1.2.3
174
202
  type: :runtime
175
203
  prerelease: false
176
204
  version_requirements: !ruby/object:Gem::Requirement
177
205
  requirements:
178
206
  - - '='
179
207
  - !ruby/object:Gem::Version
180
- version: 0.7.13
208
+ version: 1.2.3
181
209
  - !ruby/object:Gem::Dependency
182
210
  name: mail_alternatives_with_attachments
183
211
  requirement: !ruby/object:Gem::Requirement
@@ -206,6 +234,13 @@ files:
206
234
  - GPL-3-LICENSE
207
235
  - README.md
208
236
  - Rakefile
237
+ - app/controllers/api/v1/audit_log_items_controller.rb
238
+ - app/controllers/api/v1/audit_logs_controller.rb
239
+ - app/controllers/api/v1/capabilities_controller.rb
240
+ - app/controllers/api/v1/file_assets_controller.rb
241
+ - app/controllers/api/v1/groups_controller.rb
242
+ - app/controllers/api/v1/security_roles_controller.rb
243
+ - app/controllers/api/v1/users_controller.rb
209
244
  - app/controllers/erp_tech_svcs/session_controller.rb
210
245
  - app/controllers/erp_tech_svcs/user_controller.rb
211
246
  - app/mailers/user_mailer.rb
@@ -228,41 +263,39 @@ files:
228
263
  - app/models/extensions/party.rb
229
264
  - app/models/extensions/relationship_type.rb
230
265
  - app/models/extensions/role_type.rb
266
+ - app/models/extensions/tracked_status_type.rb
231
267
  - app/models/file_asset.rb
268
+ - app/models/file_asset_holder.rb
232
269
  - app/models/group.rb
233
270
  - app/models/notification.rb
234
271
  - app/models/notification_type.rb
235
272
  - app/models/scope_type.rb
236
273
  - app/models/security_role.rb
237
274
  - app/models/user.rb
238
- - app/models/user_defined_data.rb
239
- - app/models/user_defined_field.rb
240
275
  - app/validators/password_strength_validator.rb
241
276
  - app/views/user_mailer/activation_needed_email.html.erb
242
277
  - app/views/user_mailer/reset_password_email.html.erb
243
278
  - config/initializers/file_support.rb
244
- - config/initializers/pdfkit.rb
279
+ - config/initializers/logger.rb
245
280
  - config/initializers/sorcery.rb
281
+ - config/initializers/wickedpdf.rb
246
282
  - config/routes.rb
247
283
  - db/data_migrations/20110109173616_create_capability_scope_types.rb
248
284
  - db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.rb
249
285
  - db/data_migrations/20111111144706_setup_audit_log_types.rb
250
286
  - db/data_migrations/20121116155018_create_group_relationship_and_role_types.rb
251
- - db/data_migrations/20121130212146_note_capabilities.rb
287
+ - db/data_migrations/20150819140550_create_job_tracker_for_notification.rb
252
288
  - db/migrate/20080805000010_base_tech_services.rb
253
- - db/migrate/20121116151510_create_groups.rb
254
- - db/migrate/20121126171612_upgrade_security.rb
255
- - db/migrate/20121126173506_upgrade_security2.rb
256
- - db/migrate/20130410135419_add_queue_to_delayed_jobs.rb
257
- - db/migrate/20130610163240_create_notifications.rb
258
- - db/migrate/20130725212647_add_party_id_idx_to_users.rb
259
- - db/migrate/20131113213843_add_audit_log_item_old_value.rb
260
- - db/migrate/20131113213844_add_erp_tech_svcs_missing_indexes.rb
261
- - db/migrate/20131129203603_add_user_defined_fields.rb
262
- - db/migrate/20141013060204_add_custom_fields_to_notifications.rb
263
- - db/migrate/20141108182427_add_scoped_by_to_file_assets.rb
289
+ - db/migrate/20150414151421_add_nested_set_columns_to_security_role.rb
290
+ - db/migrate/20150609003216_update_user_for_sorcery.rb
291
+ - db/migrate/20150819135108_add_custom_fields_to_notifications.rb
292
+ - db/migrate/20160122155402_add_description_to_file_asset.rb
293
+ - db/migrate/20160310163060_add_created_by_updated_by_to_erp_tech_svcs.rb
294
+ - db/migrate/20160313161611_add_tenant_id_to_audit_log.rb
264
295
  - lib/erp_tech_svcs.rb
265
296
  - lib/erp_tech_svcs/config.rb
297
+ - lib/erp_tech_svcs/delayed_jobs/delete_expired_sessions_job.rb
298
+ - lib/erp_tech_svcs/delayed_jobs/notification_job.rb
266
299
  - lib/erp_tech_svcs/engine.rb
267
300
  - lib/erp_tech_svcs/erp_tech_svcs_audit_log.rb
268
301
  - lib/erp_tech_svcs/extensions.rb
@@ -271,10 +304,10 @@ files:
271
304
  - lib/erp_tech_svcs/extensions/active_record/has_capability_accessors.rb
272
305
  - lib/erp_tech_svcs/extensions/active_record/has_file_assets.rb
273
306
  - lib/erp_tech_svcs/extensions/active_record/has_security_roles.rb
274
- - lib/erp_tech_svcs/extensions/active_record/has_user_defined_data.rb
275
307
  - lib/erp_tech_svcs/extensions/active_record/is_json.rb
276
308
  - lib/erp_tech_svcs/extensions/active_record/protected_with_capabilities.rb
277
309
  - lib/erp_tech_svcs/extensions/active_record/scoped_by.rb
310
+ - lib/erp_tech_svcs/extensions/compass_ae/erp_base_erp_svcs/controllers/api/parties_controller.rb
278
311
  - lib/erp_tech_svcs/extensions/railties/action_view/base.rb
279
312
  - lib/erp_tech_svcs/extensions/railties/action_view/helpers/include_helper.rb
280
313
  - lib/erp_tech_svcs/extensions/sorcery/user_activation.rb
@@ -284,14 +317,12 @@ files:
284
317
  - lib/erp_tech_svcs/file_support/file_system_manager.rb
285
318
  - lib/erp_tech_svcs/file_support/manager.rb
286
319
  - lib/erp_tech_svcs/file_support/paperclip_patch.rb
320
+ - lib/erp_tech_svcs/file_support/railties/compass_ae_resolver.rb
287
321
  - lib/erp_tech_svcs/file_support/railties/s3_resolver.rb
288
322
  - lib/erp_tech_svcs/file_support/s3_manager.rb
289
- - lib/erp_tech_svcs/sessions/delete_expired_sessions_job.rb
290
- - lib/erp_tech_svcs/sessions/delete_expired_sessions_service.rb
291
323
  - lib/erp_tech_svcs/sms_wrapper.rb
292
324
  - lib/erp_tech_svcs/sms_wrapper/clickatell.rb
293
325
  - lib/erp_tech_svcs/utils/compass_access_negotiator.rb
294
- - lib/erp_tech_svcs/utils/compass_logger.rb
295
326
  - lib/erp_tech_svcs/utils/default_nested_set_methods.rb
296
327
  - lib/erp_tech_svcs/version.rb
297
328
  - lib/tasks/erp_tech_svcs_tasks.rake
@@ -356,7 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
356
387
  version: '0'
357
388
  requirements: []
358
389
  rubyforge_project:
359
- rubygems_version: 2.2.2
390
+ rubygems_version: 2.4.8
360
391
  signing_key:
361
392
  specification_version: 4
362
393
  summary: This engine is implemented with the premise that services like logging, tracing
@@ -1,6 +0,0 @@
1
- class UserDefinedData < ActiveRecord::Base
2
- attr_protected :created_at, :updated_at
3
-
4
- has_many :user_defined_fields
5
-
6
- end
@@ -1,8 +0,0 @@
1
- class UserDefinedField < ActiveRecord::Base
2
- attr_protected :created_at, :updated_at
3
-
4
- belongs_to :user_defined_data
5
-
6
- validates_uniqueness_of :field_name, :scope => [:user_defined_data_id]
7
-
8
- end
@@ -1,18 +0,0 @@
1
- # config/initializers/pdfkit.rb
2
- PDFKit.configure do |config|
3
- if RUBY_PLATFORM =~ /(:?mswin|mingw)/
4
- # set path to wkhtmltopdf on windows here
5
- config.wkhtmltopdf = '/opt/local/bin/wkhtmltopdf'
6
- else
7
- config.wkhtmltopdf = '/opt/local/bin/wkhtmltopdf'
8
- end
9
-
10
- config.default_options = {
11
- :page_size => 'Letter',
12
- :print_media_type => true,
13
- :disable_smart_shrinking => true,
14
- :dpi => 300,
15
- :no_background => true
16
- # :use_xserver => true
17
- }
18
- end
@@ -1,23 +0,0 @@
1
- class NoteCapabilities
2
-
3
- def self.up
4
- #insert data here
5
- admin = SecurityRole.find_or_create_by_description_and_internal_identifier(:description => 'Admin', :internal_identifier => 'admin')
6
- employee = SecurityRole.find_or_create_by_description_and_internal_identifier(:description => 'Employee', :internal_identifier => 'employee')
7
-
8
- admin.add_capability('create', 'Note')
9
- admin.add_capability('delete', 'Note')
10
- admin.add_capability('edit', 'Note')
11
- admin.add_capability('view', 'Note')
12
-
13
- employee.add_capability('create', 'Note')
14
- employee.add_capability('delete', 'Note')
15
- employee.add_capability('edit', 'Note')
16
- employee.add_capability('view', 'Note')
17
- end
18
-
19
- def self.down
20
- #remove data here
21
- end
22
-
23
- end
@@ -1,18 +0,0 @@
1
- class CreateGroups < ActiveRecord::Migration
2
- def self.up
3
- unless table_exists?(:groups)
4
- create_table :groups do |t|
5
- t.column :description, :string
6
- t.timestamps
7
- end
8
- end
9
- end
10
-
11
- def self.down
12
- [ :groups ].each do |tbl|
13
- if table_exists?(tbl)
14
- drop_table tbl
15
- end
16
- end
17
- end
18
- end
@@ -1,53 +0,0 @@
1
- class UpgradeSecurity < ActiveRecord::Migration
2
-
3
- def self.up
4
- unless table_exists?(:capability_accessors)
5
- create_table :capability_accessors do |t|
6
- t.string :capability_accessor_record_type
7
- t.integer :capability_accessor_record_id
8
- t.integer :capability_id
9
- t.timestamps
10
- end
11
-
12
- add_index :capability_accessors, :capability_id
13
- add_index :capability_accessors, [:capability_accessor_record_id, :capability_accessor_record_type], :name => 'capability_accessor_record_index'
14
- end
15
-
16
- unless columns(:capabilities).collect {|c| c.name}.include?('scope_query')
17
- add_column :capabilities, :description, :string
18
- add_column :capabilities, :capability_resource_type, :string
19
- add_column :capabilities, :capability_resource_id, :integer
20
- add_column :capabilities, :scope_type_id, :integer
21
- add_column :capabilities, :scope_query, :text
22
-
23
- add_index :capabilities, :scope_type_id
24
- add_index :capabilities, [:capability_resource_id, :capability_resource_type], :name => 'capability_resource_index'
25
- end
26
-
27
- unless table_exists?(:scope_types)
28
- create_table :scope_types do |t|
29
- t.string :description
30
- t.string :internal_identifier
31
- t.timestamps
32
- end
33
-
34
- add_index :scope_types, :internal_identifier
35
- end
36
-
37
- unless table_exists?(:parties_security_roles)
38
- create_table :parties_security_roles, :id => false do |t|
39
- t.integer :party_id
40
- t.integer :security_role_id
41
- end
42
-
43
- add_index :parties_security_roles, :party_id
44
- add_index :parties_security_roles, :security_role_id
45
- end
46
-
47
- rename_table :roles, :security_roles unless table_exists?(:security_roles)
48
-
49
- end
50
-
51
- def self.down
52
- end
53
- end