effective_committees 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/app/models/concerns/effective_committees_user.rb +8 -0
- data/app/models/effective/committee.rb +1 -1
- data/app/models/effective/committee_file.rb +1 -1
- data/app/models/effective/committee_folder.rb +1 -1
- data/app/models/effective/committee_member.rb +1 -1
- data/config/effective_committees.rb +0 -5
- data/db/migrate/{01_create_effective_committees.rb.erb → 101_create_effective_committees.rb} +11 -11
- data/lib/effective_committees/version.rb +1 -1
- data/lib/generators/effective_committees/install_generator.rb +1 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbb31cf79d4104f80164f1aa448576bdf3dbbf8d9546ee8168aad468bb3ac323
|
4
|
+
data.tar.gz: 91c44c4d88408777dbca98d9e5c9a27df9f57a7f4edd81be4cd62b53e7a7fd35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784777f99c05787247df597ebd89faa5b536cf66ecb426d98e2e5d8750f370af1e419d54b23311b69f570fe6879023aa22dd7823fa5f1f8eb23fa588ea147075
|
7
|
+
data.tar.gz: dae5f13349c215669f55f1ee65479370235f9dc29a16a2df63b23a0e2028d85f5710d489baf74b0616f202bf8e6c80b8e8926f71b842da3e54091af2d171753f
|
data/MIT-LICENSE
CHANGED
@@ -20,6 +20,14 @@ module EffectiveCommitteesUser
|
|
20
20
|
class_name: 'Effective::CommitteeMember', inverse_of: :user, dependent: :delete_all
|
21
21
|
|
22
22
|
accepts_nested_attributes_for :committee_members, allow_destroy: true
|
23
|
+
|
24
|
+
scope :with_committee, -> (committees) {
|
25
|
+
committees = Resource.new(Effective::Committee).search_any(committees) if committees.kind_of?(String)
|
26
|
+
raise('expected an Effective::Committee') unless committees.present? && Array(committees).all? { |c| c.kind_of?(Effective::Committee) }
|
27
|
+
|
28
|
+
committee_members = Effective::CommitteeMember.where(committee: committees).where(user_type: name)
|
29
|
+
where(id: committee_members.select(:user_id))
|
30
|
+
}
|
23
31
|
end
|
24
32
|
|
25
33
|
# Instance Methods
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Effective
|
4
4
|
class CommitteeFile < ActiveRecord::Base
|
5
|
-
self.table_name = EffectiveCommittees.committee_files_table_name.to_s
|
5
|
+
self.table_name = (EffectiveCommittees.committee_files_table_name || :committee_files).to_s
|
6
6
|
|
7
7
|
log_changes(to: :committee) if respond_to?(:log_changes)
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Effective
|
4
4
|
class CommitteeFolder < ActiveRecord::Base
|
5
|
-
self.table_name = EffectiveCommittees.committee_folders_table_name.to_s
|
5
|
+
self.table_name = (EffectiveCommittees.committee_folders_table_name || :committee_folders).to_s
|
6
6
|
|
7
7
|
acts_as_slugged
|
8
8
|
log_changes(to: :committee) if respond_to?(:log_changes)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Effective
|
4
4
|
class CommitteeMember < ActiveRecord::Base
|
5
|
-
self.table_name = EffectiveCommittees.committee_members_table_name.to_s
|
5
|
+
self.table_name = (EffectiveCommittees.committee_members_table_name || :committee_members).to_s
|
6
6
|
|
7
7
|
attr_accessor :user_ids, :committee_ids
|
8
8
|
|
@@ -1,9 +1,4 @@
|
|
1
1
|
EffectiveCommittees.setup do |config|
|
2
|
-
config.committees_table_name = :committees
|
3
|
-
config.committee_members_table_name = :committee_members
|
4
|
-
config.committee_folders_table_name = :committee_folders
|
5
|
-
config.committee_files_table_name = :committee_files
|
6
|
-
|
7
2
|
# Layout Settings
|
8
3
|
# Configure the Layout per controller, or all at once
|
9
4
|
# config.layout = { application: 'application', admin: 'admin' }
|
data/db/migrate/{01_create_effective_committees.rb.erb → 101_create_effective_committees.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
|
-
class CreateEffectiveCommittees < ActiveRecord::Migration[6.
|
1
|
+
class CreateEffectiveCommittees < ActiveRecord::Migration[6.0]
|
2
2
|
def change
|
3
3
|
# Committees
|
4
|
-
create_table
|
4
|
+
create_table :committees do |t|
|
5
5
|
t.string :title
|
6
6
|
t.string :slug
|
7
7
|
|
@@ -13,11 +13,11 @@ class CreateEffectiveCommittees < ActiveRecord::Migration[6.1]
|
|
13
13
|
t.datetime :created_at
|
14
14
|
end
|
15
15
|
|
16
|
-
add_index
|
17
|
-
add_index
|
16
|
+
add_index :committees, :title
|
17
|
+
add_index :committees, :slug
|
18
18
|
|
19
19
|
# Representatives
|
20
|
-
create_table
|
20
|
+
create_table :committee_members do |t|
|
21
21
|
t.integer :committee_id
|
22
22
|
t.string :committee_type
|
23
23
|
|
@@ -33,10 +33,10 @@ class CreateEffectiveCommittees < ActiveRecord::Migration[6.1]
|
|
33
33
|
t.datetime :created_at
|
34
34
|
end
|
35
35
|
|
36
|
-
add_index
|
37
|
-
add_index
|
36
|
+
add_index :committee_members, [:committee_id]
|
37
|
+
add_index :committee_members, [:user_id, :user_type]
|
38
38
|
|
39
|
-
create_table
|
39
|
+
create_table :committee_folders do |t|
|
40
40
|
t.integer :committee_id
|
41
41
|
t.string :committee_type
|
42
42
|
|
@@ -50,10 +50,10 @@ class CreateEffectiveCommittees < ActiveRecord::Migration[6.1]
|
|
50
50
|
t.datetime :created_at
|
51
51
|
end
|
52
52
|
|
53
|
-
add_index
|
54
|
-
add_index
|
53
|
+
add_index :committee_folders, [:committee_id, :committee_type]
|
54
|
+
add_index :committee_folders, [:position]
|
55
55
|
|
56
|
-
create_table
|
56
|
+
create_table :committee_files do |t|
|
57
57
|
t.integer :committee_id
|
58
58
|
t.string :committee_type
|
59
59
|
|
@@ -20,10 +20,7 @@ module EffectiveMemberships
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def create_migration_file
|
23
|
-
|
24
|
-
@committee_members_table_name = ':' + EffectiveCommittees.committee_members_table_name.to_s
|
25
|
-
|
26
|
-
migration_template ('../' * 3) + 'db/migrate/01_create_effective_committees.rb.erb', 'db/migrate/create_effective_committees.rb'
|
23
|
+
migration_template ('../' * 3) + 'db/migrate/101_create_effective_committees.rb', 'db/migrate/create_effective_committees.rb'
|
27
24
|
end
|
28
25
|
|
29
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_committees
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: haml
|
112
|
+
name: haml
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -217,7 +217,7 @@ files:
|
|
217
217
|
- config/effective_committees.rb
|
218
218
|
- config/locales/effective_committees.en.yml
|
219
219
|
- config/routes.rb
|
220
|
-
- db/migrate/
|
220
|
+
- db/migrate/101_create_effective_committees.rb
|
221
221
|
- db/seeds.rb
|
222
222
|
- lib/effective_committees.rb
|
223
223
|
- lib/effective_committees/engine.rb
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
- !ruby/object:Gem::Version
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
|
-
rubygems_version: 3.
|
247
|
+
rubygems_version: 3.3.7
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Committees are groups of users that can all share files.
|