Displaying 4 results from an estimated 4 matches for "property_value".
2005 Nov 02
4
acts_as_metadata?
...works.
Here''s the basic concept as I see it:
CREATE TABLE property(
id int not null primary key auto_increment,
ar_class varchar(255), -- AR class this property extends
property_name varchar(255),
property_type text -- MySQL or Ruby type
);
CREATE TABLE property_value(
id int not null primary key auto_increment,
foreign_id int not null, -- PK of the referenced object
property_id int not null, -- Property
has_many :property_values, PropertyValue belongs_to :property
property_value text not null -- YAML-serialized
(serialize :propert...
2006 Apr 22
0
Is it possible to have one class containing tw
...s => :markable
end
?
Based on what I know of the underlying implementation, this looks
impossible. One alternative is to declare artificial classes
PropertyName and PropertyValue, each of which has_one :value, :as =>
markable and then change Property to has_one :property_name and has_one
:property_value:
class PropertyName < ActiveRecord::Base
has_one :value, :as => :markable
end
class PropertyValue < ActiveRecord::Base
has_one :value, :as => :markable
end
class Property < ActiveRecord::Base
has_one :property_name
has_one :property_value
end
, which isn''t that...
2007 Apr 17
6
adding dynamic field to a model ...
Hi, here i describe my problem:
mi application must allow 2 basic issues:
first: the users may be able to create ''people'' (this would be a model
with a scaffold, and is not an issue, the problem comes with
requierement #2)
second: the users should be able to add new fields to that model, for
example: the model ''person'' may have 2 fields, let say:
2006 May 29
9
design recommendations for authenticating users with lots of different attributes..?
I''ve been struggling a bit trying to figure out the best way to
design/implement a system with authentication/authorization, and was
hoping some of you may be able to offer some advice..
At the moment, I have a system with 4 different types of users -
clients, administrators, sales_reps, and public_users. I''m using
"Authorizing Users with Roles" from the Rails Recipes