diff --git a/app/models/concerns/follower.rb b/app/models/concerns/follower.rb index 642d714..255ecff 100644 --- a/app/models/concerns/follower.rb +++ b/app/models/concerns/follower.rb @@ -2,22 +2,12 @@ module Follower extend ActiveSupport::Concern def follow(profile, circles) - puts "follow..." circles = [circles] unless circles.is_a?(Array) circles.each do |new_circle| -<<<<<<< HEAD next if new_circle.owner != self || !profile.kind_of?(new_circle.profile_type.constantize) -======= - puts "seguindo alguen..." - puts "profile_type: #{new_circle.profile_type}, class_name: #{profile.class.name}" - puts "new_circle.person: #{new_circle.person}, self: #{self}" if (new_circle.person != self && !(self.kind_of?(new_circle.person.class)) || new_circle.profile_type != profile.class.name) next end - puts '*20'*20 - puts "CHEGOU NO PROFILE FOLLOWER" - puts '*20'*20 ->>>>>>> parent of bfbd548... Revert "Adds new ExternalProfile module and refactor ExternalPerson" ProfileFollower.create(profile: profile, circle: new_circle) end end diff --git a/app/models/external_person.rb b/app/models/external_person.rb index c90146a..b094531 100644 --- a/app/models/external_person.rb +++ b/app/models/external_person.rb @@ -3,15 +3,11 @@ class ExternalPerson < ExternalProfile include Human include ProfileEntity -<<<<<<< HEAD include Follower - include Followable has_many :profile_followers, :as => :profile has_many :circles, :through => :profile_followers has_many :owned_circles, as: :owner, :class_name => "Circle" -======= ->>>>>>> parent of bfbd548... Revert "Adds new ExternalProfile module and refactor ExternalPerson" validates_uniqueness_of :identifier, scope: :source @@ -138,7 +134,6 @@ class ExternalPerson < ExternalProfile } end -<<<<<<< HEAD # External Person should respond to all methods in Person and Profile def person_instance_methods methods_and_responses = { @@ -272,6 +267,4 @@ class ExternalPerson < ExternalProfile end derivated_methods end -======= ->>>>>>> parent of bfbd548... Revert "Adds new ExternalProfile module and refactor ExternalPerson" end diff --git a/app/models/external_profile.rb b/app/models/external_profile.rb index d57c4ec..db72fca 100644 --- a/app/models/external_profile.rb +++ b/app/models/external_profile.rb @@ -1,6 +1,6 @@ class ExternalProfile < ActiveRecord::Base - include Follower + include Followable has_many :circles, as: :person diff --git a/db/migrate/20160822110424_rename_external_people_to_external_profiles.rb b/db/migrate/20160822110424_rename_external_people_to_external_profiles.rb deleted file mode 100644 index e1e7c65..0000000 --- a/db/migrate/20160822110424_rename_external_people_to_external_profiles.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RenameExternalPeopleToExternalProfiles < ActiveRecord::Migration - def up - rename_table :external_people, :external_profiles - end - - def down - rename_table :external_profiles, :external_people - end -end diff --git a/db/migrate/20160829170524_rename_external_people_to_external_profiles.rb b/db/migrate/20160829170524_rename_external_people_to_external_profiles.rb new file mode 100644 index 0000000..e1e7c65 --- /dev/null +++ b/db/migrate/20160829170524_rename_external_people_to_external_profiles.rb @@ -0,0 +1,9 @@ +class RenameExternalPeopleToExternalProfiles < ActiveRecord::Migration + def up + rename_table :external_people, :external_profiles + end + + def down + rename_table :external_profiles, :external_people + end +end diff --git a/db/migrate/20160829185118_add_type_to_external_profile.rb b/db/migrate/20160829185118_add_type_to_external_profile.rb new file mode 100644 index 0000000..67709cf --- /dev/null +++ b/db/migrate/20160829185118_add_type_to_external_profile.rb @@ -0,0 +1,9 @@ +class AddTypeToExternalProfile < ActiveRecord::Migration + def up + add_column :external_profiles, :type, :string, default: "ExternalProfile" + end + + def down + remove_column :external_profiles, :type + end +end -- libgit2 0.21.2