search for: friendships

Displaying 20 results from an estimated 106 matches for "friendships".

Did you mean: friendship
2006 Mar 31
6
Adding objects to a :through association
So I''m one of those nasty people building a self-referential habtm-like Association using the funky new :through stuff. This is about users having friends, so here''s my user.rb: class User < ActiveRecord::Base has_many :friendships, :foreign_key => ''user_id'' has_many :friends, :through => :friendships, :source => :friend end And here''s my friendship.rb: class Friendship < ActiveRecord::Base belongs_to :user belongs_to :friend, :class_name => ''User'', :foreign_...
2008 Jan 07
2
acts_as_state_machine override :initial state
Hello, I''m not sure if this is where to post this, but i cannot find much information/support for acts_as_state_machine. I have a Friendship model which implements acts_as_state_machine. I have an :initial state of :pending, but i would like to create a Friendship model and save it directly with :accepted status. I have tried Friendship.create(:state => "accepted") and
2010 Feb 16
0
Strange routing(?) Issue
...PUT /users/:user_id/ roles/:id(.:format) {:action=>"update", :controller=>"roles"} DELETE /users/:user_id/ roles/:id(.:format) {:action=>"destroy", :controller=>"roles"} user_friendships GET /users/:user_id/ friendships(.:format) {:action=>"index", :controller=>"friendships"} POST /users/:user_id/ friendships(.:format) {:action=>"create", :controller=>"friendships"} new_user_f...
2006 May 28
7
Self-referential has_many :through relationship
...end b = blocked My models look like this: class Relationship < ActiveRecord::Base belongs_to :user belongs_to :friend, :class_name => ''User'', :foreign_key => ''friend_id'' end class User < ActiveRecord::Base has_many :relationships has_many :friendships, :class_name => ''Relationship'', :foreign_key => ''user_id'', :conditions => "relation = ''f''" has_many :potential_friendships, :class_name => ''Relationship'', :foreign_key => ''user_id'',...
2006 Aug 15
2
How to access attribute in a self-referential many-to-many relationship
Hello List, I created a self-referential many-to-many relationship (as described in the book Rails recipe #18), where I have a model that has many-to-many relationships with itself. In this case, it''s person who can become friends. The join table looks like this: mysql> select * from friends_people; +-----------+-----------+-----------+ | person_id | friend_id | confirmed |
2009 Feb 02
2
ActiveRecord::AssociationTypeMismatch (User(#54754560) expected, got User(#54510280))
i keep getting this AssociationTypeMismatch error. i think this could be a bug related to ruby/rails when using mixins. heres a short version of my code: # user.rb require ''friend_invitation'' require ''friendship'' class User < ActiveRecord::Base include FriendInvitationUser, FriendshipUser ... end # friendship.rb ... module FriendshipUser def
2008 Mar 27
0
Need help in Friendship plugin
I have used salted hash login generator for login system. Now what I want to do is use Friendship plugin. I have searched for Friendship plugin tutorial but tutorial use restful authentication login controller.I am trying to develop demo social networking project. Plz help me guys how do I integrate Friendship plugin with salted hash login generator what I am using.
2006 Mar 25
0
Self-Referential Many-To-Many relationships where the relationship itself has data.
...is, they have ratings for their friends. I have gone through the Rails Recipes book, and it seems like I''m trying to combine the self-referential many-to-many recipe (12) and the many to many relationships where the relationship itself has data recipe (16). So users have unique names, and friendships have user_id''s, friend_id''s, and ratings. And here''s the model code: class User < ActiveRecord::Base has_and_belongs_to_many :all_friends, :class_name => "User", :join_table => "friendships", :foreign_key => "user_id&quo...
2007 May 10
5
Pagination has many through problems
...at i have: Controller ========== class ProfilesController < ApplicationController def friends current_user.profile.friends end def list_friends @profile_pages, @profiles = paginate( friends, :per_page => 10) end end Models ====== class Profile < ActiveRecord::Base has_many :friendships has_many :friends, :through => :friendships end class Friendship < ActiveRecord::Base belongs_to :profile belongs_to :friend, :class_name => "Profile", :foreign_key => "friend_id" end When accessing "http://localhost:3000/profiles/list_friends&qu...
2008 Nov 20
3
Any progress on undirected self-referential many to many relationships?
...nformation), and a friendship database with two entries in the database per friendship (<Bob, Alice> and <Alice, Bob>). But that seems inefficient. Is there a better way to do this? Alternatively, is there a way to merge 2 lists into a single has_many? Like this: has_many :initiated_friendships, :foreign_key =>''befriender_id'', :class_name => ''Friendship'', :dependent => :destroy has_many :received_friendships, :foreign_key =>''befriendee_id'',...
2009 Jun 14
6
Unable to make observe_field work
I can''t make it work. <%= text_field_tag :friend %> <%= observe_field :friend, :url => friendships_url, :on => :click %> <%= javascript_include_tag :defaults %> Raises the error:Can''t find variable Form. The generated html is: <input id="friend" name="friend" type="text" /> <script type="text/javascript"> //<![CDAT...
2007 Jan 05
1
(Enhancement?) for self referential has_many :through, w/ scoped create...
We have a User model and a Connection model which basically represents edges in a digraph (User to User, self-referenctial). Each of these edges can have a :connection_type which is currently just a char(1). has_many :friendships, :class_name => ''Connection'', :foreign_key => "source_user_id", :conditions => "connection_type = ''f''" has_many :friends, :through => :friendships, :source => :targ...
2009 Jul 02
2
working with texts
WinXP, R-2.9.1 LS., I have been trying to solve a (for me) tricky issue. No matter what I've tried, I just can't find a way to do this. This is the issue: I have a text file (ansi text) "titles.txt" with lines of text; here is an example of such a file: >>>>> a brief history of polio vaccines anti-vaccination movements and their interpretations early warning
2008 Jan 11
5
Missing methods
We have a custom implementation of the Mother Object idea. It''s inside of a module, basically like this: module Factory %w(account friendship person invitation message asset email_address birth).each do |klass| eval <<-EOF def self.create_#{klass}(attributes = {}) default_attributes = valid_#{klass}_attributes #{klass.camelize}.create!
2008 Mar 20
1
How to get device name with device id?
Hi all, I want to open a device(/dev/sda1, /dev/hda2 etc) in which my file exists. I've used 'stat' system call to get the device id. But now I want the device name from this id(st_dev). How to get that one? Or Do you have any other method to know the device name where my file resides? Thanks Bollywood, fun, friendship, sports and more. You name it, we have it on
2016 Feb 15
1
GTX 960M
I'm considering a Dell XPS 15 laptop, that comes with the subject GPU. Is this thing usable with nouveau? -- ======================================================================== Ian Pilcher arequipeno at gmail.com -------- "I grew up before Mark Zuckerberg invented friendship" --------
2017 Mar 13
2
MIPS emulation broken - No PCI buses available
I am trying to create a QEMU MIPS guest, so that I can test some code for big-endian safety. Every attempt to create a MIPS guest is giving me an error: Unable to complete install: 'XML error: No PCI buses available' It seems like this is a known issue. https://www.redhat.com/archives/libvir-list/2016-May/msg00197.html However, I am still getting this on a fully updated Fedora
2018 May 31
2
Make discard='unmap' the default?
Is it possible to make discard='unmap' the default for virtio-scsi disks? (Related, is it possible to make virtio-scsi the default disk type, rather than virtio-blk?) Thanks! -- ======================================================================== Ian Pilcher arequipeno@gmail.com -------- "I grew up before Mark Zuckerberg invented
2019 Sep 15
1
How to disable i915 module
I am setting up CentOS 7 on my new firewall. This will run as a head- less system, accessed via a serial console when necessary. It's only a 2GB system, so I don't see any reason to have the GPU consuming any of the RAM. I've blacklisted the i915, drm, and drm_kms_helper modules and rebuilt the initramfs, but the i915 module is still being loaded. Anyone know what might be loading
2003 May 09
1
correspondence analysis
Hi everybody, I am starting my friendship with R. Now I want to do a Correspondence Analysis using the vegan library or multiv library. Both give me the same results which differ from the ones I get running other programs like Statistica... I wounder if there is a problem with my matrix. I have cualitataive variable in the columns and sampling units in the rows... I import my matrix into R