acts_as_data_owner 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ module ActiveRecord
|
|
6
6
|
fields = [:creator, :owner, :updater]
|
7
7
|
fields += [options[:include]].flatten if options[:include]
|
8
8
|
fields -= [options[:exclude]].flatten if options[:exclude]
|
9
|
-
|
9
|
+
prefix = options[:prefix] if options[:prefix]
|
10
10
|
#Add fields to table
|
11
11
|
change_table table_name do |t|
|
12
12
|
fields.each do |f|
|
@@ -16,7 +16,7 @@ module ActiveRecord
|
|
16
16
|
|
17
17
|
#Add indexes
|
18
18
|
fields.each do |f|
|
19
|
-
add_index table_name, "#{f}_id"
|
19
|
+
add_index table_name, "#{f}_id",:name=>(prefix ? "#{prefix}_#{f}" : "index_#{table_name}_on_#{f}" )
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_data_owner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-08 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|