Hi
In my application to seed data I am using seed_fu
(http://github.com/mbleigh/seed-fu)
I have tables roles,privileges and permissions( It joins roles and
privileges). Now at application startup I have to seed these tables with
data. But during runtime some additionals rows may be added to
permissions. But I dont how at a later stage if I run rake db:seed_fu
all data that I set later to permissions may be wipeout. I dont know how
to handle this.
As an example
role
=====
1 admin
2 contact
3 employee
privilege
=========
1 add_contact
2 edit_contact
3 delete_employee
permissions (role_id,privilege_id)
=======================
1 1
1 2
3 2 .........etc
Suppose this may be seeded at startup. Later additional entries
may go to permissions. One of my question is how can I use seed_fu to
fill data for permissions table? Can I do it as usual like create
db/fixtures/permission.rb and
Permission.seed_many(:id, :id, [
{ :role_id => 1, :privilege_id => 1 },
{ :role_id => 1, :privilege_id => 2 },
{ :role_id => 3, :privilege_id => 2 }
])
One more question is if I follow like above and at a later stage if
run rake db:seed_fu again all data that where added later to permission
will be lost. And also how can I ensure that all the id values above
should be what I expected. Please guide me
Thanks in advance
Tom
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.