Skip to content

Commit

Permalink
renamed the module containing friendship model from 'Friendship' to '…
Browse files Browse the repository at this point in the history
…Friendships'
  • Loading branch information
raw1z committed Mar 6, 2012
1 parent 6de57b6 commit aef9f05
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/amistad.rb
Expand Up @@ -10,5 +10,5 @@ module Amistad
autoload :MongoidFriendModel
autoload :FriendshipModel
autoload :FriendModel
autoload :Friendship
autoload :Friendships
end
6 changes: 3 additions & 3 deletions lib/amistad/active_record_friend_model.rb
Expand Up @@ -7,7 +7,7 @@ module ActiveRecordFriendModel
# friendships
#####################################################################################
has_many :friendships,
:class_name => "Amistad::Friendship::#{Amistad.friendship_model}",
:class_name => "Amistad::Friendships::#{Amistad.friendship_model}",
:foreign_key => "friendable_id"

has_many :pending_invited,
Expand All @@ -24,7 +24,7 @@ module ActiveRecordFriendModel
# inverse friendships
#####################################################################################
has_many :inverse_friendships,
:class_name => "Amistad::Friendship::#{Amistad.friendship_model}",
:class_name => "Amistad::Friendships::#{Amistad.friendship_model}",
:foreign_key => "friend_id"

has_many :pending_invited_by,
Expand All @@ -41,7 +41,7 @@ module ActiveRecordFriendModel
# blocked friendships
#####################################################################################
has_many :blocked_friendships,
:class_name => "Amistad::Friendship::#{Amistad.friendship_model}",
:class_name => "Amistad::Friendships::#{Amistad.friendship_model}",
:foreign_key => "blocker_id"

has_many :blockades,
Expand Down
2 changes: 1 addition & 1 deletion lib/amistad/config.rb
Expand Up @@ -15,7 +15,7 @@ def friendship_model
end

def friendship_class
Amistad::Friendship.const_get(self.friendship_model)
Amistad::Friendships.const_get(self.friendship_model)
end
end
end
2 changes: 1 addition & 1 deletion lib/amistad/friendship.rb → lib/amistad/friendships.rb
@@ -1,5 +1,5 @@
module Amistad
module Friendship
module Friendships
if Object.const_defined? :ActiveRecord
const_set Amistad.friendship_model, Class.new(ActiveRecord::Base)
const_get(Amistad.friendship_model.to_sym).class_exec do
Expand Down

0 comments on commit aef9f05

Please sign in to comment.