Displaying 7 results from an estimated 7 matches for "enumerations_mixin".
2006 Feb 17
4
Table with Constants
I would like to have a table with some constants to use them later on
for a drop down menu. How can this be done?
My table looks like
Table with constants
------------------------
id | key | value | type
------------------------
1 | M | Male | sex
....
I know it can be done like this
<% select ''object'', ''method'', Constants.find(:all, :select =>
2006 Jul 12
5
DRY version of RoR book PAYMENT_TYPES example
In the book there is an example how to convert DB payment value to more
readable from. PAYMENT_TYPES array is defined and then in your views you
can use it as Order::PAYMENT_TYPES.
The problem is: how should I convert DB values (for example with type
char(1)) to full string representation. I know that I can add a Hash to
a model: IM = {''S'' => ''Skype'',
2006 Mar 08
2
Exciting Website Development
I am a single person company designing an exciting new web application
for the general internet community.
I am looking for 1 or 2 RoR developers keen to be involved in the
development of an online application over the next few months.
This project will initially be a free service for all internet user with
the option for revenue through other sources later on - hence I am
looking for
2007 Aug 14
1
What's the good way to cache reference data?
I''m looking at an application that has 30+ lookup tables. By that I
mean your typical (id, description, created_on) affairs that contain
locations, zip codes, contract types and what not. Things that rarely
change, and are maintained by administrators.
It''s well known that when you have many lookup tables in the schema,
eager loading is not good enough anymore, and you need to
2006 Jun 26
5
How can I dynamiclly generate models?
I am trying to write a plugin, ''acts_as_commentable'', for my models -
Image, Book, Music and so on, I do not want to use polymorphic
association, so very model should have its own comment class.
Here is my code
acts_as_commentable.rb
module Commentable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def
2006 Nov 08
3
How to implement status codes in DB and Rails
This is more of a design issue I''m wrestling with, and was wondering
what other people are doing.
I have a products table with status values of In Stock, Out of Stork or
Discontinued. This is unlikely to change any time soon.
Approach A, is to have thses actual values in the status column, at
least the meaning is very apparent, yet querying for products with a
specific status could
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