alvinsj / flatten_record

An ActiveRecord plugin that denormalizes your existing ActiveRecord models
MIT License
82 stars 9 forks source link

allow renaming of generated field #4

Closed alvinsj closed 10 years ago

alvinsj commented 10 years ago

add a rename/map option to denomalizer definition to allow renaming of generated field.
e.g.:

denormalize :order do |order|
  order.denormalize :customer do |customer|
    customer.map :name, :customer_name
  end
end
alvinsj commented 10 years ago

i will be working on enabling custom prefix for denormalized fields, raise error if field with same names exist. e.g.

denormalize :order do |order|
  order.denormalize :customer, prefix: :cust # generated fields will be i.e. cust_first_name
end
alvinsj commented 10 years ago

pull request https://github.com/alvinsj/flatten_record/pull/16 for v1.0 include implementation of custom prefix