ecm_staff2 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/ecm/staff/business_unit.rb +3 -15
- data/app/models/ecm/staff/organisation.rb +2 -10
- data/app/models/ecm/staff/person.rb +7 -22
- data/app/models/ecm/staff/person_position.rb +0 -11
- data/app/models/ecm/staff/position.rb +3 -11
- data/config/locales/de.yml +6 -2
- data/config/routes.rb +1 -1
- data/db/migrate/001_create_ecm_staff_organisations.rb +1 -1
- data/db/migrate/002_create_ecm_staff_business_units.rb +1 -1
- data/db/migrate/003_create_ecm_staff_positions.rb +1 -1
- data/db/migrate/004_create_ecm_staff_person_positions.rb +1 -1
- data/db/migrate/005_create_ecm_staff_people.rb +1 -1
- data/db/migrate/006_create_ecm_staff_organisation_translations.rb +1 -1
- data/db/migrate/007_create_ecm_staff_business_unit_translations.rb +1 -1
- data/db/migrate/008_create_ecm_staff_position_translations.rb +1 -1
- data/db/migrate/009_create_ecm_staff_person_translations.rb +1 -1
- data/db/migrate/20170611221519_drop_translation_table_for_business_units.rb +13 -0
- data/db/migrate/20170611221534_drop_translation_table_for_organsiations.rb +13 -0
- data/db/migrate/20170611221542_drop_translation_table_for_people.rb +13 -0
- data/db/migrate/20170611221546_drop_translation_table_for_positions.rb +13 -0
- data/lib/ecm/staff/version.rb +1 -1
- data/lib/ecm_staff2.rb +0 -1
- data/spec/factories/ecm_staff_people.rb +1 -0
- metadata +7 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac39e10a4689a2a1fdca68806b7685cb480de90a
|
4
|
+
data.tar.gz: 2f7b00490f379dd3356420e898dc9eb70a1d1ea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76c62c75e370cf17cd0fac89d27e01194d34d30c098d419346efb0ce6f57db91898229b0eaf05bec5b9ec4ff47fb1fde4c0a5d4104c094320e3bcde15f0311d2
|
7
|
+
data.tar.gz: c43ec106e8bd3258297c5f98c3ec3ee8ac0466cea9bf280afad891366ee43e9925767834ae0d69062b8822978885698cd269173c76b52e9cf9f64da344cf36fa
|
@@ -4,28 +4,17 @@ class Ecm::Staff::BusinessUnit < Ecm::Staff::Base
|
|
4
4
|
has_many :person_positions, dependent: :restrict_with_error
|
5
5
|
has_many :people, through: :person_positions
|
6
6
|
|
7
|
-
# # attributes
|
8
|
-
# attr_accessible :description,
|
9
|
-
# :name,
|
10
|
-
# :markup_language,
|
11
|
-
# :organisation_id,
|
12
|
-
# :parent_id,
|
13
|
-
# :slug
|
14
|
-
|
15
7
|
# callbacks
|
16
8
|
after_initialize :set_defaults, if: :new_record?
|
17
9
|
|
18
|
-
# globalization support
|
19
|
-
translates :description, :name, :slug
|
20
|
-
# attr_accessible :translations, :translations_attributes
|
21
|
-
accepts_nested_attributes_for :translations
|
22
|
-
|
23
10
|
# default scope
|
24
11
|
# default_scope order: 'lft'
|
12
|
+
|
13
|
+
translates :description, :name, :slug if ActiveRecord::Base.connection.table_exists?(:ecm_staff_business_unit_translations)
|
25
14
|
|
26
15
|
# friendly id support
|
27
16
|
extend FriendlyId
|
28
|
-
friendly_id :name, use: [:slugged
|
17
|
+
friendly_id :name, use: [:slugged]
|
29
18
|
|
30
19
|
# markup support
|
31
20
|
acts_as_markup language: :variable,
|
@@ -35,7 +24,6 @@ class Ecm::Staff::BusinessUnit < Ecm::Staff::Base
|
|
35
24
|
acts_as_nested_set
|
36
25
|
|
37
26
|
# validations
|
38
|
-
validates :organisation, presence: true
|
39
27
|
validates :name, presence: true,
|
40
28
|
uniqueness: { scope: [:organisation_id] }
|
41
29
|
|
@@ -2,22 +2,14 @@ class Ecm::Staff::Organisation < Ecm::Staff::Base
|
|
2
2
|
# associations
|
3
3
|
has_many :business_units
|
4
4
|
|
5
|
-
# # attributes
|
6
|
-
# attr_accessible :description,
|
7
|
-
# :markup_language,
|
8
|
-
# :name
|
9
|
-
|
10
5
|
# callbacks
|
11
6
|
after_initialize :set_defaults, if: :new_record?
|
12
7
|
|
13
|
-
|
14
|
-
translates :description, :name, :slug
|
15
|
-
# attr_accessible :translations, :translations_attributes
|
16
|
-
accepts_nested_attributes_for :translations
|
8
|
+
translates :description, :name, :slug if ActiveRecord::Base.connection.table_exists?(:ecm_staff_organisation_translations)
|
17
9
|
|
18
10
|
# friendly id support
|
19
11
|
extend FriendlyId
|
20
|
-
friendly_id :name, use: [:slugged
|
12
|
+
friendly_id :name, use: [:slugged]
|
21
13
|
|
22
14
|
# markup support
|
23
15
|
acts_as_markup language: :variable,
|
@@ -1,49 +1,34 @@
|
|
1
1
|
class Ecm::Staff::Person < Ecm::Staff::Base
|
2
2
|
# associations
|
3
3
|
has_many :person_positions, ->() { order(begin_at: :desc) },
|
4
|
-
class_name: Ecm::Staff::PersonPosition,
|
4
|
+
class_name: 'Ecm::Staff::PersonPosition',
|
5
5
|
inverse_of: :person
|
6
6
|
accepts_nested_attributes_for :person_positions, allow_destroy: true
|
7
7
|
|
8
8
|
has_many :positions, through: :person_positions,
|
9
|
-
class_name: Ecm::Staff::Position
|
9
|
+
class_name: 'Ecm::Staff::Position'
|
10
10
|
|
11
11
|
has_many :attached_pictures, as: :pictureable,
|
12
|
-
class_name: Ecm::Pictures::AttachedPicture,
|
12
|
+
class_name: 'Ecm::Pictures::AttachedPicture',
|
13
13
|
inverse_of: :pictureable
|
14
14
|
has_many :pictures, through: :attached_pictures,
|
15
|
-
class_name: Ecm::Pictures::Picture
|
15
|
+
class_name: 'Ecm::Pictures::Picture'
|
16
16
|
|
17
17
|
accepts_nested_attributes_for :attached_pictures, allow_destroy: true
|
18
18
|
accepts_nested_attributes_for :pictures, allow_destroy: true
|
19
19
|
|
20
|
-
# # attributes
|
21
|
-
# attr_accessible :attached_pictures_attributes,
|
22
|
-
# :birthdate,
|
23
|
-
# :description,
|
24
|
-
# :firstname,
|
25
|
-
# :lastname,
|
26
|
-
# :markup_language,
|
27
|
-
# :person_positions_attributes,
|
28
|
-
# :pictures_attributes,
|
29
|
-
# :position,
|
30
|
-
# :prefix
|
31
|
-
|
32
20
|
# acts as list
|
33
21
|
acts_as_list
|
34
22
|
# default_scope order: 'position ASC'
|
35
23
|
|
24
|
+
translates :description, :prefix, :slug if ActiveRecord::Base.connection.table_exists?(:ecm_staff_person_translations)
|
25
|
+
|
36
26
|
# callbacks
|
37
27
|
after_initialize :set_defaults, if: :new_record?
|
38
28
|
|
39
|
-
# globalization support
|
40
|
-
translates :description, :prefix, :slug
|
41
|
-
# attr_accessible :translations, :translations_attributes
|
42
|
-
accepts_nested_attributes_for :translations
|
43
|
-
|
44
29
|
# friendly id support
|
45
30
|
extend FriendlyId
|
46
|
-
friendly_id :fullname, use: [:slugged
|
31
|
+
friendly_id :fullname, use: [:slugged]
|
47
32
|
|
48
33
|
# markup support
|
49
34
|
acts_as_markup language: :variable,
|
@@ -5,18 +5,7 @@ class Ecm::Staff::PersonPosition < Ecm::Staff::Base
|
|
5
5
|
belongs_to :person, class_name: Ecm::Staff::Configuration.person_class_name
|
6
6
|
belongs_to :position
|
7
7
|
|
8
|
-
# # attributes
|
9
|
-
# attr_accessible :begin_at,
|
10
|
-
# :business_unit_id,
|
11
|
-
# :end_at,
|
12
|
-
# :organisation_id,
|
13
|
-
# :person_id,
|
14
|
-
# :position_id
|
15
|
-
|
16
8
|
# validations
|
17
9
|
# @TODO: Validate end_at > begin_at if present
|
18
10
|
validates :begin_at, presence: true
|
19
|
-
validates :business_unit, presence: true
|
20
|
-
validates :person, presence: true
|
21
|
-
validates :position, presence: true
|
22
11
|
end
|
@@ -4,22 +4,14 @@ class Ecm::Staff::Position < Ecm::Staff::Base
|
|
4
4
|
has_many :people, through: :person_positions,
|
5
5
|
class_name: Ecm::Staff::Configuration.person_class_name
|
6
6
|
|
7
|
-
# # attributes
|
8
|
-
# attr_accessible :description,
|
9
|
-
# :name,
|
10
|
-
# :parent_id
|
11
|
-
|
12
7
|
# callbacks
|
13
8
|
after_initialize :set_defaults, if: :new_record?
|
14
9
|
|
15
|
-
# globalization support
|
16
|
-
translates :description, :name, :slug
|
17
|
-
# attr_accessible :translations, :translations_attributes
|
18
|
-
accepts_nested_attributes_for :translations
|
19
|
-
|
20
10
|
# friendly id support
|
21
11
|
extend FriendlyId
|
22
|
-
friendly_id :name, use: [:slugged
|
12
|
+
friendly_id :name, use: [:slugged]
|
13
|
+
|
14
|
+
translates :description, :name, :slug if ActiveRecord::Base.connection.table_exists?(:ecm_staff_position_translations)
|
23
15
|
|
24
16
|
# markup support
|
25
17
|
acts_as_markup language: :variable,
|
data/config/locales/de.yml
CHANGED
@@ -19,7 +19,9 @@ de:
|
|
19
19
|
markup_language: Markupsprache
|
20
20
|
name: Name
|
21
21
|
organisation_id: Unternehmen
|
22
|
+
organisation: Unternehmen
|
22
23
|
parent_id: Übergeordnete Abteilung
|
24
|
+
parent: Übergeordnete Abteilung
|
23
25
|
created_at: Erstellt am
|
24
26
|
updated_at: Aktualisiert am
|
25
27
|
ecm/staff/organisation:
|
@@ -37,6 +39,7 @@ de:
|
|
37
39
|
lastname: Nachname
|
38
40
|
markup_language: Markupsprache
|
39
41
|
person_positions: Stellen
|
42
|
+
pictures: Bilder
|
40
43
|
position: Position
|
41
44
|
prefix: Prefix
|
42
45
|
preview_picture: Bild
|
@@ -57,7 +60,8 @@ de:
|
|
57
60
|
show:
|
58
61
|
back: 'Zurück'
|
59
62
|
routes:
|
60
|
-
|
63
|
+
ecm_staff_engine: team
|
61
64
|
business_units: 'abteilungen'
|
62
65
|
organsiations: 'organisationen'
|
63
|
-
people: 'mitarbeiter'
|
66
|
+
people: 'mitarbeiter'
|
67
|
+
positions: 'stellen'
|
data/config/routes.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
class DropTranslationTableForBusinessUnits < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
reversible do |dir|
|
4
|
+
dir.up do
|
5
|
+
Ecm::Staff::BusinessUnit.drop_translation_table!
|
6
|
+
end
|
7
|
+
|
8
|
+
dir.down do
|
9
|
+
Ecm::Staff::BusinessUnit.create_translation_table! name: :string, description: :text, slug: :string
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class DropTranslationTableForOrgansiations < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
reversible do |dir|
|
4
|
+
dir.up do
|
5
|
+
Ecm::Staff::Organisation.drop_translation_table!
|
6
|
+
end
|
7
|
+
|
8
|
+
dir.down do
|
9
|
+
Ecm::Staff::Organisation.create_translation_table! name: :string, description: :text, slug: :string
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class DropTranslationTableForPeople < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
reversible do |dir|
|
4
|
+
dir.up do
|
5
|
+
Ecm::Staff::Person.drop_translation_table!
|
6
|
+
end
|
7
|
+
|
8
|
+
dir.down do
|
9
|
+
Ecm::Staff::Person.create_translation_table! prefix: :string, description: :text, slug: :string
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class DropTranslationTableForPositions < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
reversible do |dir|
|
4
|
+
dir.up do
|
5
|
+
Ecm::Staff::Position.drop_translation_table!
|
6
|
+
end
|
7
|
+
|
8
|
+
dir.down do
|
9
|
+
Ecm::Staff::Position.create_translation_table! name: :string, description: :text, slug: :string
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/ecm/staff/version.rb
CHANGED
data/lib/ecm_staff2.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_staff2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: globalize
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: route_translator
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,6 +106,10 @@ files:
|
|
120
106
|
- db/migrate/007_create_ecm_staff_business_unit_translations.rb
|
121
107
|
- db/migrate/008_create_ecm_staff_position_translations.rb
|
122
108
|
- db/migrate/009_create_ecm_staff_person_translations.rb
|
109
|
+
- db/migrate/20170611221519_drop_translation_table_for_business_units.rb
|
110
|
+
- db/migrate/20170611221534_drop_translation_table_for_organsiations.rb
|
111
|
+
- db/migrate/20170611221542_drop_translation_table_for_people.rb
|
112
|
+
- db/migrate/20170611221546_drop_translation_table_for_positions.rb
|
123
113
|
- lib/ecm/staff.rb
|
124
114
|
- lib/ecm/staff/configuration.rb
|
125
115
|
- lib/ecm/staff/engine.rb
|
@@ -151,9 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
141
|
version: '0'
|
152
142
|
requirements: []
|
153
143
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
144
|
+
rubygems_version: 2.6.11
|
155
145
|
signing_key:
|
156
146
|
specification_version: 4
|
157
147
|
summary: Ecm::Staff.
|
158
148
|
test_files: []
|
159
|
-
has_rdoc:
|