erp_tech_svcs 3.0.12 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/app/controllers/erp_tech_svcs/session_controller.rb +1 -1
  2. data/app/models/attribute_type.rb +2 -0
  3. data/app/models/attribute_value.rb +2 -0
  4. data/app/models/audit_log.rb +4 -1
  5. data/app/models/audit_log_item.rb +2 -0
  6. data/app/models/audit_log_item_type.rb +2 -0
  7. data/app/models/audit_log_type.rb +2 -0
  8. data/app/models/capability.rb +2 -1
  9. data/app/models/capability_type.rb +2 -0
  10. data/app/models/extensions/category.rb +3 -0
  11. data/app/models/extensions/compass_ae_instance.rb +3 -0
  12. data/app/models/file_asset.rb +3 -1
  13. data/app/models/group.rb +5 -18
  14. data/app/models/scope_type.rb +1 -0
  15. data/app/models/security_role.rb +2 -0
  16. data/app/models/user.rb +29 -42
  17. data/app/views/user_mailer/activation_needed_email.html.erb +1 -1
  18. data/app/views/user_mailer/reset_password_email.html.erb +1 -1
  19. data/config/initializers/erp_tech_svcs.rb +2 -0
  20. data/db/data_migrations/20121130212146_note_capabilities.rb +2 -2
  21. data/db/migrate/20080805000010_base_tech_services.rb +3 -3
  22. data/lib/erp_tech_svcs/config.rb +4 -0
  23. data/lib/erp_tech_svcs/extensions/active_record/acts_as_versioned.rb +105 -106
  24. data/lib/erp_tech_svcs/extensions/active_record/has_capability_accessors.rb +4 -10
  25. data/lib/erp_tech_svcs/extensions/active_record/has_security_roles.rb +2 -0
  26. data/lib/erp_tech_svcs/extensions/active_record/protected_with_capabilities.rb +28 -53
  27. data/lib/erp_tech_svcs/extensions/railties/action_view/base.rb +8 -0
  28. data/lib/erp_tech_svcs/extensions/railties/action_view/helpers/include_helper.rb +28 -0
  29. data/lib/erp_tech_svcs/extensions.rb +3 -0
  30. data/lib/erp_tech_svcs/file_support/railties/s3_resolver.rb +1 -1
  31. data/lib/erp_tech_svcs/sms_wrapper/clickatell.rb +3 -3
  32. data/lib/erp_tech_svcs/utils/compass_access_negotiator.rb +4 -6
  33. data/lib/erp_tech_svcs/version.rb +2 -2
  34. data/lib/erp_tech_svcs.rb +2 -1
  35. data/spec/dummy/config/application.rb +6 -0
  36. data/spec/dummy/config/environments/spec.rb +3 -0
  37. data/spec/dummy/config/s3.yml +23 -0
  38. data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +14 -0
  39. data/spec/dummy/db/migrate/{20130105133955_base_erp_services.erp_base_erp_svcs.rb → 20130107214445_base_erp_services.erp_base_erp_svcs.rb} +0 -0
  40. data/spec/dummy/db/migrate/{20130105133956_base_tech_services.erp_tech_svcs.rb → 20130107214446_base_tech_services.erp_tech_svcs.rb} +0 -0
  41. data/spec/dummy/db/migrate/{20130105133957_create_has_attribute_tables.erp_tech_svcs.rb → 20130107214447_create_has_attribute_tables.erp_tech_svcs.rb} +0 -0
  42. data/spec/dummy/db/migrate/{20130105133958_create_groups.erp_tech_svcs.rb → 20130107214448_create_groups.erp_tech_svcs.rb} +0 -0
  43. data/spec/dummy/db/migrate/{20130105133959_upgrade_security.erp_tech_svcs.rb → 20130107214449_upgrade_security.erp_tech_svcs.rb} +0 -0
  44. data/spec/dummy/db/migrate/{20130105133960_upgrade_security2.erp_tech_svcs.rb → 20130107214450_upgrade_security2.erp_tech_svcs.rb} +0 -0
  45. data/spec/dummy/db/schema.rb +1 -1
  46. data/spec/dummy/db/spec.sqlite3 +0 -0
  47. data/spec/dummy/log/spec.log +15314 -121571
  48. data/spec/dummy/move_test_tmp/file_asset_spec_text.txt +1 -0
  49. data/spec/lib/erp_tech_svcs/extensions/active_record/has_roles_spec.rb +6 -6
  50. data/spec/lib/file_support/s3_manager_spec.rb +1 -0
  51. data/spec/models/audit_log_spec.rb +1 -1
  52. data/spec/models/file_asset_spec.rb +14 -5
  53. data/spec/models/group_spec.rb +41 -0
  54. data/spec/models/security_role_spec.rb +26 -0
  55. data/spec/models/user_spec.rb +12 -2
  56. data/spec/spec_helper.rb +12 -7
  57. metadata +65 -48
  58. data/db/data_migrations/upgrade/20120727152144_set_image_dimensions_on_file_assets.rb +0 -13
  59. data/db/migrate/upgrade/20111109161549_add_capabilites.rb +0 -56
  60. data/db/migrate/upgrade/20111109161550_update_roles.rb +0 -35
  61. data/db/migrate/upgrade/20111109161551_update_user.rb +0 -88
  62. data/db/migrate/upgrade/20120329161641_add_file_asset_indexes.rb +0 -22
  63. data/db/migrate/upgrade/20120517203052_add_queue_to_delayed_jobs.rb +0 -13
  64. data/db/migrate/upgrade/20120725205131_add_image_dimension_columns_to_file_asset.rb +0 -15
  65. data/lib/erp_tech_svcs/application_installer.rb +0 -102
  66. data/lib/erp_tech_svcs/utils/attachment_fu_patch.rb +0 -15
  67. data/lib/erp_tech_svcs/utils/compass_pdf.rb +0 -72
  68. data/lib/erp_tech_svcs/utils/pdf_processor.rb +0 -106
  69. data/spec/dummy/log/adam.log +0 -1
  70. data/spec/factories/role.rb +0 -5
  71. data/spec/models/role_spec.rb +0 -17
  72. data/spec/models/secured_model_spec.rb +0 -22
@@ -77,8 +77,7 @@ module ErpTechSvcs
77
77
 
78
78
  # pass in (capability_type_iid, klass) or (capability) object
79
79
  def add_capability(*capability)
80
- capability_type_iid = capability.first.is_a?(Symbol) ? capability.first.to_s : capability.first
81
- capability = capability_type_iid.is_a?(String) ? get_or_create_capability(capability_type_iid, capability.second) : capability.first
80
+ capability = capability.first.is_a?(String) ? get_or_create_capability(capability.first, capability.second) : capability.first
82
81
  ca = CapabilityAccessor.find_or_create_by_capability_accessor_record_type_and_capability_accessor_record_id_and_capability_id(get_superclass, self.id, capability.id)
83
82
  self.reload
84
83
  ca
@@ -90,12 +89,8 @@ module ErpTechSvcs
90
89
 
91
90
  def get_or_create_capability(capability_type_iid, klass)
92
91
  capability_type = convert_capability_type(capability_type_iid)
93
- if klass.is_a?(String)
94
- scope_type = ScopeType.find_by_internal_identifier('class')
95
- Capability.find_or_create_by_capability_resource_type_and_capability_type_id_and_scope_type_id(klass, capability_type.id, scope_type.id)
96
- else
97
- klass.add_capability(capability_type_iid) # create instance capability
98
- end
92
+ scope_type = ScopeType.find_by_internal_identifier('class')
93
+ Capability.find_or_create_by_capability_resource_type_and_capability_type_id_and_scope_type_id(klass, capability_type.id, scope_type.id)
99
94
  end
100
95
 
101
96
  def get_capability(capability_type_iid, klass)
@@ -106,8 +101,7 @@ module ErpTechSvcs
106
101
 
107
102
  # pass in (capability_type_iid, klass) or (capability) object
108
103
  def remove_capability(*capability)
109
- capability_type_iid = capability.first.is_a?(Symbol) ? capability.first.to_s : capability.first
110
- capability = capability_type_iid.is_a?(String) ? get_or_create_capability(capability_type_iid, capability.second) : capability.first
104
+ capability = capability.first.is_a?(String) ? get_or_create_capability(capability.first, capability.second) : capability.first
111
105
  ca = capability_accessors.where(:capability_accessor_record_type => get_superclass, :capability_accessor_record_id => self.id, :capability_id => capability.id).first
112
106
  ca.destroy unless ca.nil?
113
107
  self.reload
@@ -14,6 +14,8 @@ module ErpTechSvcs
14
14
 
15
15
  module ClassMethods
16
16
  def has_security_roles
17
+ has_and_belongs_to_many :security_roles
18
+
17
19
  extend HasSecurityRoles::SingletonMethods
18
20
  include HasSecurityRoles::InstanceMethods
19
21
  end
@@ -9,24 +9,15 @@ module ErpTechSvcs
9
9
 
10
10
  module ClassMethods
11
11
 
12
- def protected_with_capabilities(options = {})
12
+ def protected_with_capabilities
13
13
  extend ProtectedByCapabilities::SingletonMethods
14
14
  include ProtectedByCapabilities::InstanceMethods
15
-
16
- has_many :capabilities, :as => :capability_resource
17
15
 
18
- # protect all instance of this class by default
19
- class_attribute :protect_all_instances
20
- self.protect_all_instances = (options[:protect_all_instances].nil? ? false : options[:protect_all_instances])
21
-
22
- # Get records filtered via query scope capabilities
23
- # By default Compass AE treats query scopes as restrictions
24
- # A user will see all records unless the user has a capability accessor with a query scope
25
- # If you set :protect_all_instances => true it is honored via with_user_security & with_instance_security but NOT with_query_security
26
- # arguments: user, capability_type_iids
27
- # capability_type_iids is optional and can be a single string or an array of strings
28
- # Example: which files can this user download? FileAsset.with_query_security(user, 'download').all
29
- # Example: which website sections can this user either view or edit? WebsiteSection.with_query_security(user, ['view','edit']).all
16
+ has_many :capabilities, :as => :capability_resource
17
+
18
+ # get records filtered via query scope capabilities
19
+ # by default Compass AE treats query scopes as restrictions
20
+ # a user will see all records unless the user has a capability accessor with a query scope
30
21
  scope :with_query_security, lambda{|*args|
31
22
  raise ArgumentError if args.empty? || args.size > 2
32
23
  user = args.first
@@ -34,11 +25,11 @@ module ErpTechSvcs
34
25
  capability_type_iids = [capability_type_iids] if capability_type_iids.is_a?(String)
35
26
 
36
27
  scope_type = ScopeType.find_by_internal_identifier('query')
37
- granted_capabilities = user.all_capabilities.where(:scope_type_id => scope_type.id).where(:capability_resource_type => self.name)
28
+ granted_capabilities = user.all_capabilities.collect{|c| c if c.scope_type_id == scope_type.id and c.capability_resource_type == self.name }.compact
38
29
 
39
30
  unless capability_type_iids.empty?
40
31
  capability_type_ids = capability_type_iids.collect{|type| convert_capability_type(type).id }
41
- granted_capabilities = granted_capabilities.where("capability_type_id IN (?)", capability_type_ids.join(','))
32
+ granted_capabilities = granted_capabilities.collect{|c| c if capability_type_ids.include?(c.capability_type_id)}.compact
42
33
  end
43
34
 
44
35
  query = nil
@@ -48,45 +39,34 @@ module ErpTechSvcs
48
39
  query
49
40
  }
50
41
 
51
- # Get records for this model permitted via instance capabilities
52
- # If :protect_all_instances => true return only instances user has explicitly been granted access to
53
- # If :protect_all_instances => false return instances without capabilities or that user is granted access to (default)
42
+ # get records for this model without capabilities or that are not in a list of denied capabilities
43
+ scope :with_instance_security, lambda{|denied_capabilities|
44
+ query = joins("LEFT JOIN capabilities AS c ON c.capability_resource_id = #{self.table_name}.id AND c.capability_resource_type = '#{self.name}'").
45
+ group(columns.collect{|c| "#{self.table_name}.#{c.name}" })
46
+ query = (denied_capabilities.empty? ? query.where("c.id IS NULL OR c.id = c.id") : query.where("c.id IS NULL OR c.id NOT IN (?)", denied_capabilities.collect{|c| c.id }))
47
+ query
48
+ }
49
+
50
+ # get records for this model that the given user has access to
54
51
  # arguments: user, capability_type_iids
55
52
  # capability_type_iids is optional and can be a single string or an array of strings
56
- # Example: which files can this user download? FileAsset.with_instance_security(user, 'download').all
57
- # Example: which website sections can this user either view or edit? WebsiteSection.with_instance_security(user, ['view','edit']).all
58
- scope :with_instance_security, lambda{|*args|
53
+ # Example: which files can this user download? FileAsset.with_user_security(user, 'download').all
54
+ # Example: which website sections can this user either view or edit? WebsiteSection.with_user_security(user, ['view','edit']).all
55
+ scope :with_user_security, lambda{|*args|
59
56
  raise ArgumentError if args.empty? || args.size > 2
60
57
  user = args.first
61
58
  capability_type_iids = args.second || []
62
59
  capability_type_iids = [capability_type_iids] if capability_type_iids.is_a?(String)
63
60
 
64
61
  scope_type = ScopeType.find_by_internal_identifier('instance')
65
- granted_capabilities = user.all_capabilities.where(:scope_type_id => scope_type.id).where(:capability_resource_type => self.name)
62
+ granted_capabilities = user.all_capabilities.collect{|c| c if c.scope_type_id == scope_type.id and c.capability_resource_type == self.name }.compact
66
63
 
67
64
  unless capability_type_iids.empty?
68
65
  capability_type_ids = capability_type_iids.collect{|type| convert_capability_type(type).id }
69
- granted_capabilities = granted_capabilities.where("capability_type_id IN (#{capability_type_ids.join(',')})")
66
+ granted_capabilities = granted_capabilities.collect{|c| c if capability_type_ids.include?(c.capability_type_id)}.compact
70
67
  end
71
-
72
- denied_capabilities = instance_capabilities.select('capabilities.id').where("capabilities.id NOT IN (#{granted_capabilities.select('capabilities.id').to_sql})")
73
- deny_count = denied_capabilities.count
74
-
75
- join_type = (self.protect_all_instances ? 'JOIN' : 'LEFT JOIN')
76
- query = joins("#{join_type} capabilities AS c ON c.capability_resource_id = #{self.table_name}.id AND c.capability_resource_type = '#{self.name}'").
77
- group(columns.collect{|c| "#{self.table_name}.#{c.name}" })
78
- query = (deny_count == 0 ? query.where("c.id IS NULL OR c.id = c.id") : query.where("c.id IS NULL OR c.id NOT IN (#{denied_capabilities.to_sql})"))
79
- query
80
- }
81
-
82
- # Get records for this model that the given user has access to
83
- # arguments: user, capability_type_iids
84
- # capability_type_iids is optional and can be a single string or an array of strings
85
- # Example: which files can this user download? FileAsset.with_user_security(user, 'download').all
86
- # Example: which website sections can this user either view or edit? WebsiteSection.with_user_security(user, ['view','edit']).all
87
- scope :with_user_security, lambda{|*args|
88
- raise ArgumentError if args.empty? || args.size > 2
89
- with_instance_security(*args).with_query_security(*args)
68
+
69
+ with_query_security(*args).with_instance_security(instance_capabilities - granted_capabilities)
90
70
  }
91
71
  end
92
72
  end
@@ -122,9 +102,9 @@ module ErpTechSvcs
122
102
  capabilities.where(:scope_type_id => scope_type.id)
123
103
  end
124
104
 
125
- # return unique roles on capabilities for this model
105
+ # collect unique roles on capabilities
126
106
  def capability_roles
127
- SecurityRole.joins(:capability_accessors => :capability).where(:capability_accessors => {:capabilities => {:capability_resource_type => get_superclass(self.name) }}).all.uniq
107
+ capabilities.collect{|c| c.roles }.flatten.uniq
128
108
  end
129
109
 
130
110
  # add a class level capability (capability_resource_id will be NULL)
@@ -167,11 +147,6 @@ module ErpTechSvcs
167
147
 
168
148
  module InstanceMethods
169
149
 
170
- # convenience method to access class method
171
- def protect_all_instances
172
- self.class.protect_all_instances
173
- end
174
-
175
150
  def add_capability(capability_type_iid)
176
151
  capability_type = convert_capability_type(capability_type_iid)
177
152
  scope_type = ScopeType.find_by_internal_identifier('instance')
@@ -190,11 +165,11 @@ module ErpTechSvcs
190
165
  end
191
166
 
192
167
  def protected_with_capability?(capability_type_iid)
193
- !get_capability(capability_type_iid).nil? or protect_all_instances
168
+ !get_capability(capability_type_iid).nil?
194
169
  end
195
170
 
196
171
  def allow_access?(user, capability_type_iid)
197
- if (!self.protect_all_instances and !self.protected_with_capability?(capability_type_iid.to_s)) or (user and user.has_capability?(capability_type_iid.to_s, self))
172
+ if !self.protected_with_capability?(capability_type_iid.to_s) or (user and user.has_capability?(capability_type_iid.to_s, self))
198
173
  return true
199
174
  else
200
175
  return false
@@ -0,0 +1,8 @@
1
+ #require all ActionView helper files
2
+ Dir.entries(File.join(File.dirname(__FILE__),"helpers")).delete_if{|name| name =~ /^\./}.each do |file|
3
+ require "erp_tech_svcs/extensions/railties/action_view/helpers/#{file}"
4
+ end
5
+
6
+ ActionView::Base.class_eval do
7
+ include ErpTechSvcs::Extensions::Railties::ActionView::Helpers::IncludeHelper
8
+ end
@@ -0,0 +1,28 @@
1
+ module ErpTechSvcs
2
+ module Extensions
3
+ module Railties
4
+ module ActionView
5
+ module Helpers
6
+ module IncludeHelper
7
+
8
+ def set_max_file_upload
9
+ raw "<script type='text/javascript'>Ext.ns('ErpTechSvcs.Config'); ErpTechSvcs.Config.max_file_size_in_mb = #{ErpTechSvcs::Config.max_file_size_in_mb};</script>"
10
+ end
11
+
12
+ def set_email_regex
13
+ raw "<script type='text/javascript'>ErpTechSvcs.Config.email_regex = \"#{ErpTechSvcs::Config.email_regex}\";</script>"
14
+ end
15
+
16
+ def set_file_upload_types
17
+ raw "<script type='text/javascript'>ErpTechSvcs.Config.file_upload_types = \"#{ErpTechSvcs::Config.file_upload_types}\";</script>"
18
+ end
19
+
20
+ def set_erp_tech_config_vars
21
+ raw "#{set_max_file_upload} #{set_email_regex} #{set_file_upload_types}"
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,6 @@
1
+ #railties
2
+ require 'erp_tech_svcs/extensions/railties/action_view/base'
3
+
1
4
  #active record extensions
2
5
  require 'erp_tech_svcs/extensions/active_record/base'
3
6
  require 'erp_tech_svcs/extensions/active_record/has_file_assets'
@@ -19,7 +19,7 @@ module ActionView
19
19
  def cached(key, path_info, details, locals) #:nodoc:
20
20
  file_support = ErpTechSvcs::FileSupport::Base.new(:storage => :s3)
21
21
  name, prefix, partial = path_info
22
- locals = sort_locals(locals)
22
+ locals = locals.map { |x| x.to_s }.sort!
23
23
 
24
24
  if key && caching?
25
25
  if @cached[key][name][prefix][partial][locals].nil? or @cached[key][name][prefix][partial][locals].empty?
@@ -20,6 +20,6 @@ module ErpTechSvcs
20
20
  result
21
21
  end
22
22
 
23
- end
24
- end
25
- end
23
+ end #Clickatell
24
+ end #SmsWrapper
25
+ end #ErpTechSvcs
@@ -13,17 +13,15 @@ module ErpTechSvcs
13
13
  where(:capability_resource_type => klass).
14
14
  where(:scope_type_id => scope_type.id).
15
15
  where(:capability_types => {:internal_identifier => capability_type_iid}).first
16
- return nil if capability.nil? # capability not found so return nil
17
16
  else
18
17
  scope_type = ScopeType.find_by_internal_identifier('instance')
19
18
  capability = klass.capabilities.joins(:capability_type).
20
19
  where(:scope_type_id => scope_type.id).
21
20
  where(:capability_types => {:internal_identifier => capability_type_iid}).first
22
- # if capability not found, we see if all instances are protected
23
- # if all instance are protected, return false, otherwise true
24
- return !klass.protect_all_instances if capability.nil?
21
+ return true if capability.nil? # object is not secured, so return true
25
22
  end
26
- all_capabilities.include?(capability)
23
+ result = all_capabilities.find{|c| c == capability }
24
+ result.nil? ? false : true
27
25
  end
28
26
 
29
27
  # pass in (capability_type_iid, class name or any class instance, a block of code)
@@ -52,7 +50,7 @@ module ErpTechSvcs
52
50
  end
53
51
  end
54
52
 
55
- class CapabilityAlreadytExists < StandardError
53
+ class CapabilityAlreadyExists < StandardError
56
54
  def to_s
57
55
  "Capability already exists."
58
56
  end
@@ -1,8 +1,8 @@
1
1
  module ErpTechSvcs
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
- MINOR = 0
5
- TINY = 12
4
+ MINOR = 1
5
+ TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
data/lib/erp_tech_svcs.rb CHANGED
@@ -4,14 +4,15 @@ require 'erp_base_erp_svcs'
4
4
  require 'paperclip'
5
5
  require 'delayed_job'
6
6
  require 'delayed_job_active_record'
7
+ require 'mail_alternatives_with_attachments'
7
8
  require 'sorcery'
8
9
  require 'pdfkit'
10
+ require 'aws'
9
11
  require "erp_tech_svcs/version"
10
12
  require "erp_tech_svcs/utils/compass_logger"
11
13
  require "erp_tech_svcs/utils/default_nested_set_methods"
12
14
  require "erp_tech_svcs/utils/compass_access_negotiator"
13
15
  require "erp_tech_svcs/extensions"
14
- require 'aws'
15
16
  require 'erp_tech_svcs/file_support'
16
17
  require 'erp_tech_svcs/sms_wrapper'
17
18
  require "erp_tech_svcs/config"
@@ -38,6 +38,12 @@ module Dummy
38
38
 
39
39
  # Enable the asset pipeline
40
40
  config.assets.enabled = true
41
+
42
+ # Enforce whitelist mode for mass assignment.
43
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
44
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
45
+ # parameters by using an attr_accessible or attr_protected declaration.
46
+ config.active_record.whitelist_attributes = true
41
47
  end
42
48
  end
43
49
 
@@ -1,6 +1,9 @@
1
1
  Dummy::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
+ # Raise exception on mass assignment protection for Active Record models
5
+ config.active_record.mass_assignment_sanitizer = :strict
6
+
4
7
  # In the development environment your application's code is reloaded on
5
8
  # every request. This slows down response time but is perfect for development
6
9
  # since you don't have to restart the web server when you make code changes.
@@ -0,0 +1,23 @@
1
+ common: &common
2
+ access_key_id: AKIAIK3DDLVVJUWSHVPQ
3
+ secret_access_key: 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
4
+
5
+ production:
6
+ <<: *common
7
+ bucket: terralab
8
+
9
+ development:
10
+ <<: *common
11
+ bucket: terralabdev
12
+
13
+ test:
14
+ <<: *common
15
+ bucket: terralabtest
16
+
17
+ spec:
18
+ <<: *common
19
+ bucket: terralabtest
20
+
21
+ adam:
22
+ <<: *common
23
+ bucket: terralab
@@ -0,0 +1,14 @@
1
+ # This migration comes from erp_tech_svcs (originally 20120109173616)
2
+ class CreateDownloadCapabilityType
3
+
4
+ def self.up
5
+ CapabilityType.create(:internal_identifier => 'download', :description => 'Download')
6
+ Role.create(:description => 'File Downloader', :internal_identifier => 'file_downloader')
7
+ end
8
+
9
+ def self.down
10
+ CapabilityType.where("internal_identifier = 'download'").first.destroy unless Role.where("internal_identifier = 'download'").first.nil?
11
+ Role.where("internal_identifier = 'file_downloader'").first.destroy unless Role.where("internal_identifier = 'file_downloader'").first.nil?
12
+ end
13
+
14
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20130105133960) do
14
+ ActiveRecord::Schema.define(:version => 20130107214450) do
15
15
 
16
16
  create_table "attribute_types", :force => true do |t|
17
17
  t.string "internal_identifier"
Binary file