similar to: polymorphic challenge

Displaying 20 results from an estimated 3000 matches similar to: "polymorphic challenge"

2006 Jun 23
2
polymorphic challenge
Hello All, I have a little challenge and I am not sure if this is even possible I am working on a dating/event site and few functionalities are similar that I want to centralize them. We have users which can have - favorite users - interest list - blocked users All these relations are like; User <-> Relation <-> User I was thinking I could have a class called Relation (with a
2006 Nov 27
0
how to select with a kind of through relation(has_one)
I have a select issue with my members, my database structure is below User has many shops Shop belongs to a membership Shop has many items For front page I want to show items where membership of the shop has ad_enabled and this is what I have in mind but it returns with "Association named ''membership'' was not found; perhaps you misspelled it?" I tried to add to Item
2006 Jun 18
10
acts_as_enumerated
Hello All, Any one using acts_as_enumerated? I need help using (I like that it caches values in memory) I am working on a dating website and there are lots of options I want to store as enumerated like Status; divorce, single, Sex: male, female Eye color; blue, brown, green.... and lots more.... But I do not wanna keep them in seperate tables, and wanna keep them all together. Anyone has a
2006 Mar 22
5
foreach item in column
Hi there, I have a database with phonenumbers, and I want to make a function that runs a command for each of these numbers, with the number as an argument Something like this in Perl: system("/bin/command $number"); mysql> select * from numbers where list = "one" +----+----------+----------+---------------------+-----------+ | id | number | name | email
2006 Apr 25
3
limiting options in file_upload
Does anyone know if it''s possible to set constraints to the size & type of file that file_column will accept? I''d like to limit to image files of less than 2MB. If this isn''t possible with file_column, is there a graceful way of getting the controller to handle it? thanks dorian -- -- I do things for love or money
2006 Jan 26
4
Override has_many :order at run-time?
Is it possible to override has_many''s :order attribute at run-time? e.g. something like: <% for category in @site.categories(:order=>''name'') %> ... <% for category in @site.categories(:order=>''rank'') %> ... thanks csn -- Posted via http://www.ruby-forum.com/.
2008 Oct 26
0
daylight savings time difference with rspec?
Hi all, I wanted to check this with you. I have an rspec example that checks the correct expiration date set on an object. The expiration is set in the model with expires_on = Time.now + next_duration[phase] where next_duration can either be in units of seconds or n.days (should be the same thing). n can be 3, 7, 25, or 30 days. in my example I check an interval because the two events are not
2006 Jan 20
8
validates_confirmation_of not working
is there any special requirement for validates_confirmation_of ? I am trying to make sure 2 passwords are equal (cleanly the rails way).. In my view i have two fields with id user[password] and user[password_confirmation]. in the model i have validates_confirmation_of :password, :message =>"Passwords do not match " Am i missing something here ? thanks adam
2005 Oct 20
3
Missing id on date_select (0.14.1)
I''m getting markup violation errors on my tests and I noticed that a template with this (a modified 0.13.1 generated scaffold). <label for="credit_card_account">Account</label> <%= text_field ''credit_card'', ''account'' %> <label for="credit_card_expires_on">Expires on</label>
2005 Dec 14
3
image upload (apache2.0+ lighttpd)
Hello all, I use lighttpd 1.4.8 and I have a problem with image uploads. I tried file_upload plugin, but it is strangely working sometimes and refuse to work sometimes. Function in the controller is (@user is loaded in before_filter) def update_watermark @user.watermark = params[:user][:watermark] @user.save redirect_to :action => "index" end Model is
2006 Apr 01
4
Saving images in shared directory w/ Capistrano/SVN?
Hi all, I''m using Capistrano and SVN to version control and deploy, but I''m not sure what to do about my images directory. I use file_column and RMagick to save images to the disk under a model called "Image", and they''re saved in public/image/... etc. Each time I deploy a new version, my image folder doesn''t exist anymore. I don''t want
2006 Jun 07
2
Qick Q: Expression in this Controller
I tried putting this inside my controller: def goodbye @link = Link_to "goodbye!", :action =>"goodbye" end and display it in my views calling the @link variable. Of course it doesn''t work. Why? Thanks -- Posted via http://www.ruby-forum.com/.
2006 Mar 22
3
Problems with validates_presence_of...anybody?
Hello everybody, I have been developing small applications in Rails from quite some time. But lately, I came across a bug which I have not been able to correct. If anybody could help me with it, would be of great help thankyou. Actually, the problem is that I have a form in my application with some set of fields. Now what "validates_presence_of" should do is that if I submit the form
2006 May 24
0
polymorphic url and polymorphic partial helpers
Here are a couple of articles I wrote describing a couple of handy helpers for dealing with polymorphic objects. These helpers allow you to generate urls and render partials on objects without knowing what class they are ahead of time. http://www.sciwerks.com/blog/2006/05/24/polymorphic-urls/ http://www.sciwerks.com/blog/2006/05/24/polymorphic-partials/ Hopefully you will find them useful.
2006 Mar 03
2
Through relationship
I am working on streamlining one of my apps, and trying to wrap my hands around through, polymorphic, and with_scope. All of these i know i need for what i want to do, based on the little documentation I have found. With this in mid I have tried to implement a simple through in the app to try and get my head around it. This is what I have: class Product < ActiveRecord::Base
2011 May 03
2
Database performance for polymorphic associations under high load
Hey guys, I''ve been thinking lately about polymorphic associations, and I wonder: is there a noticeable or tangible performance "hit" from doing polymorphic associations when you''ve got your database under really high query load? So for example, maybe I have a "message" model, a "user" model and an "administrator" model, without any
2006 Jul 10
2
Polymorphic associations in reverse?
My app has an association that''s got me scratching my head. I have Users, and Images. A User has many Images. (Yes, another picture sharing app, but it''s for a small niche, and it doesn''t end in -r!) I would like to express a "Favorite" relationship between both Users to Users, and Users to Images. This seems like the opposite of the standard
2006 Jan 10
3
Serving lots of images to only registred users
Hello guys, I am building a photo website and I have some questions before I really start programming the site. My system will be Debian + lighttpd + mysql +fastcgi + ImageMagick I plan to use file_column for image handling/verification and thumbnail creation. My question is; I need to store images in a place outside of webroot so only registered members can see them. To serve them secure
2010 Mar 01
0
undefined method for Polymorphic association using Searchlogic
I am unable to call a polymorphic scope using the searchlogic plugin as it keeps on returning ''undefined method''. I am certain it is only a problem within my project as I created a test project and I was able to call a polymorphic scope using the searchlogic plugin. I am hoping someone can provide a suggestion on how to debug this issue. My project consists of several gems, and
2008 May 13
0
Polymorphic naming difficulties
Hi all. I''m having a problem naming a polymorphic relationship. Here''s my thinking... First, an analogy. You''re walking through the mall. Through a window you see a game you''re interested. I''m attempting to model the relationship between your interest and the game you''re interested in. I have an InterestList. It''s job is to maintain