-
Notifications
You must be signed in to change notification settings - Fork 0
Plugin to define and use custom attributes for a model
License
skaczor/custom_attributes
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Permits managing custom attributes for Active Record models. Unlike other plugins, custom_attributes uses an associated model to define which columns should be available for the current model. For example, suppose that you have a catalog of items for sale (Item model), such as Monitors, Hard Disks, etc. Each item needs attributes that are specific only for its category (Category Model). Therefore, let's define that Monitors should have the display_size and dpi attributes, while Hard Disks should define capacity and rpm. class Category < ActiveRecord::Base include Customizable defines_custom_columns end class Item < ActiveRecord::Base belongs_to :category include Customizable has_custom_attributes_based_on(:category) end The plugin will automatically create the required attributes for each Item model, based on its association with the Category model.
About
Plugin to define and use custom attributes for a model
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published