ecm_staff2 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f74bbb1b554ec04f7963934bba4cb55f0a86712d
4
- data.tar.gz: 4740aef068369f7fb2ead41183998b48838269f8
3
+ metadata.gz: ac39e10a4689a2a1fdca68806b7685cb480de90a
4
+ data.tar.gz: 2f7b00490f379dd3356420e898dc9eb70a1d1ea5
5
5
  SHA512:
6
- metadata.gz: 3a6381eaec3198c36a7d045b541049f439b657e5f6b3f2533bf79ba71181f30a7f365b98c5e3635e2e4729095c03c963c8b24f10f842c3cecc429bd64bbff14c
7
- data.tar.gz: 93813b0f34c73ba472b610e2013b115860b5ade78f7cf3088648d2ffcd5bb971b9c6ecdaecdcd5c79b3ac11d7dd70adaab3a05ac1aeb58ac9f29de8cb170c0f5
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, :finders]
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
- # globalization support
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, :globalize, :finders]
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, :finders]
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, :finders]
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,
@@ -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
- ecm_staff: 'team'
63
+ ecm_staff_engine: team
61
64
  business_units: 'abteilungen'
62
65
  organsiations: 'organisationen'
63
- people: 'mitarbeiter'
66
+ people: 'mitarbeiter'
67
+ positions: 'stellen'
@@ -1,6 +1,6 @@
1
1
  Ecm::Staff::Engine.routes.draw do
2
2
  localized do
3
- scope :ecm_staff do
3
+ scope :ecm_staff_engine do
4
4
  resources :organisations, only: [:show, :index]
5
5
  resources :business_units, only: [:show, :index]
6
6
  resources :people, only: [:show, :index]
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffOrganisations < ActiveRecord::Migration
1
+ class CreateEcmStaffOrganisations < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_staff_organisations do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffBusinessUnits < ActiveRecord::Migration
1
+ class CreateEcmStaffBusinessUnits < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_staff_business_units do |t|
4
4
  t.references :organisation
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffPositions < ActiveRecord::Migration
1
+ class CreateEcmStaffPositions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_staff_positions do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffPersonPositions < ActiveRecord::Migration
1
+ class CreateEcmStaffPersonPositions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_staff_person_positions do |t|
4
4
  t.references :person
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffPeople < ActiveRecord::Migration
1
+ class CreateEcmStaffPeople < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_staff_people do |t|
4
4
  t.string :prefix
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffOrganisationTranslations < ActiveRecord::Migration
1
+ class CreateEcmStaffOrganisationTranslations < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  Ecm::Staff::Organisation.create_translation_table!({
4
4
  name: :string,
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffBusinessUnitTranslations < ActiveRecord::Migration
1
+ class CreateEcmStaffBusinessUnitTranslations < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  Ecm::Staff::BusinessUnit.create_translation_table!({
4
4
  name: :string,
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffPositionTranslations < ActiveRecord::Migration
1
+ class CreateEcmStaffPositionTranslations < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  Ecm::Staff::Position.create_translation_table!({
4
4
  name: :string,
@@ -1,4 +1,4 @@
1
- class CreateEcmStaffPersonTranslations < ActiveRecord::Migration
1
+ class CreateEcmStaffPersonTranslations < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  Ecm::Staff::Person.create_translation_table!({
4
4
  prefix: :string,
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Staff
3
- VERSION = '2.0.0'.freeze
3
+ VERSION = '3.0.0'.freeze
4
4
  end
5
5
  end
@@ -1,6 +1,5 @@
1
1
  require 'awesome_nested_set'
2
2
  require 'friendly_id'
3
- require 'globalize'
4
3
  require 'route_translator'
5
4
 
6
5
  require 'ecm/staff'
@@ -4,5 +4,6 @@ FactoryGirl.define do
4
4
  factory :ecm_staff_person, class: Ecm::Staff::Person do
5
5
  firstname 'John'
6
6
  lastname 'Doe'
7
+ markup_language 'textile'
7
8
  end
8
9
  end
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: 2.0.0
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-05-07 00:00:00.000000000 Z
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.4.8
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: