[Git][noosfero/noosfero][master] 3 commits: Fixes indentation

Rodrigo Souto gitlab at mg.gitlab.com
Mon Oct 29 18:22:23 BRST 2018


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
d688f4fb by MatheusRich at 2018-10-24T15:38:37Z
Fixes indentation

- - - - -
623f64d1 by MatheusRich at 2018-10-24T15:38:55Z
Adds migration to remove templates from article authors

- - - - -
0a2e6341 by Rodrigo Souto at 2018-10-29T20:22:20Z
Merge branch 'fix-content-author' into 'master'

Fix content author

See merge request noosfero/noosfero!1634
- - - - -


3 changed files:

- app/models/organization.rb
- app/models/person.rb
- + db/migrate/20181024151736_remove_person_template_from_article_author.rb


Changes:

=====================================
app/models/organization.rb
=====================================
@@ -3,7 +3,9 @@ class Organization < Profile
 
 include OrganizationHelper
 
-  attr_accessible :moderated_articles, :foundation_year, :contact_person, :acronym, :legal_form, :economic_activity, :management_information, :cnpj, :display_name, :enable_contact_us
+  attr_accessible :moderated_articles, :foundation_year, :contact_person,
+                  :acronym, :legal_form, :economic_activity, :management_information,
+                  :cnpj, :display_name, :enable_contact_us
   attr_accessible :requires_email
 
   settings_items :requires_email, type: :boolean


=====================================
app/models/person.rb
=====================================
@@ -1,7 +1,11 @@
 # A person is the profile of an user holding all relationships with the rest of the system
 class Person < Profile
 
-  attr_accessible :organization, :contact_information, :sex, :birth_date, :cell_phone, :comercial_phone, :jabber_id, :personal_website, :nationality, :schooling, :schooling_status, :formation, :custom_formation, :area_of_study, :custom_area_of_study, :professional_activity, :organization_website, :following_articles, :editor
+  attr_accessible :organization, :contact_information, :sex, :birth_date, :cell_phone,
+                  :comercial_phone, :jabber_id, :personal_website, :nationality, :schooling,
+                  :schooling_status, :formation, :custom_formation, :area_of_study,
+                  :custom_area_of_study, :professional_activity, :organization_website,
+                  :following_articles, :editor
 
   SEARCH_FILTERS = {
     :order => %w[more_recent more_popular more_active],
@@ -245,27 +249,27 @@ class Person < Profile
   end
 
   FIELDS = %w[
-  description
-  preferred_domain
-  nickname
-  sex
-  birth_date
-  nationality
-  cell_phone
-  comercial_phone
-  personal_website
-  jabber_id
-  schooling
-  formation
-  custom_formation
-  area_of_study
-  custom_area_of_study
-  professional_activity
-  organization
-  organization_website
-  contact_phone
-  contact_information
-  location
+    description
+    preferred_domain
+    nickname
+    sex
+    birth_date
+    nationality
+    cell_phone
+    comercial_phone
+    personal_website
+    jabber_id
+    schooling
+    formation
+    custom_formation
+    area_of_study
+    custom_area_of_study
+    professional_activity
+    organization
+    organization_website
+    contact_phone
+    contact_information
+    location
   ] + LOCATION_FIELDS
 
   validates_multiparameter_assignments


=====================================
db/migrate/20181024151736_remove_person_template_from_article_author.rb
=====================================
@@ -0,0 +1,7 @@
+class RemovePersonTemplateFromArticleAuthor < ActiveRecord::Migration
+  def change
+    templates = Person.where(is_template: true).ids
+
+    Article.where("author_id in (?)", templates).update_all(author_id: nil)
+  end
+end



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/5ed563c06e2a454cfbd24156121bcadf031bd6b9...0a2e6341d3794cca18c487e7c54d993e84a0bc50

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/5ed563c06e2a454cfbd24156121bcadf031bd6b9...0a2e6341d3794cca18c487e7c54d993e84a0bc50
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20181029/59d759b2/attachment-0001.html>


More information about the Noosfero-dev mailing list