[Git][noosfero/noosfero][master] oauth_client: fix association declaration

Bráulio Bhavamitra gitlab at mg.gitlab.com
Tue Mar 1 20:11:02 BRT 2016


Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero


Commits:
f2aaabd6 by Braulio Bhavamitra at 2016-03-01T20:10:14-03:00
oauth_client: fix association declaration

- - - - -


1 changed file:

- plugins/oauth_client/lib/ext/profile.rb


Changes:

=====================================
plugins/oauth_client/lib/ext/profile.rb
=====================================
--- a/plugins/oauth_client/lib/ext/profile.rb
+++ b/plugins/oauth_client/lib/ext/profile.rb
@@ -1,10 +1,8 @@
 require_dependency 'profile'
 
-Profile.descendants.each do |subclass|
-  subclass.class_eval do
+class Profile
 
-    has_many :oauth_auths, foreign_key: :profile_id, class_name: 'OauthClientPlugin::Auth', dependent: :destroy
-    has_many :oauth_providers, through: :oauth_auths, source: :provider
+  has_many :oauth_auths, foreign_key: :profile_id, class_name: 'OauthClientPlugin::Auth', dependent: :destroy
+  has_many :oauth_providers, through: :oauth_auths, source: :provider
 
-  end
 end



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/f2aaabd6dd85b2e436d734c6420ae91e4599c347
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160301/9f846d0a/attachment.html>


More information about the Noosfero-dev mailing list