acts_as_data_owner 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -39,6 +39,19 @@ module ActsAsDataOwner
|
|
39
39
|
where(conditions)
|
40
40
|
}
|
41
41
|
|
42
|
+
scope :personal, lambda {
|
43
|
+
conditions = {}
|
44
|
+
#Filter by User Ids Who has access to Products
|
45
|
+
conditions["#{self.table_name}.owner_id"] = ([Person.current.id] + Person.manage_people_ids).compact if fields.include?(:owner)
|
46
|
+
|
47
|
+
if fields.include?(:company)
|
48
|
+
company_ids = ([(Person.current.current_company ? Person.current.current_company.id : nil)] + Person.manage_company_ids).compact
|
49
|
+
conditions["#{self.table_name}.company_id"] = company_ids if company_ids.any?
|
50
|
+
end
|
51
|
+
|
52
|
+
where(conditions)
|
53
|
+
}
|
54
|
+
|
42
55
|
|
43
56
|
#has_paper_trail(:meta => {:person_id => Proc.new { |p| (p.updater_id || p.creator_id) }})
|
44
57
|
|
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.7
|
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-07-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|