I'm teaching myself Rails through PragProg's (apparently outdated - I'm using Rails 3.2.3) Rails for PHP Developers. I've discovered this seeds.rb file that the book doesn't talk about. I've tried to build proper seed entries for a number of things and it's giving me can't mass-assign protected attributes
.
After a bunch of searching, it appears my only option is to open these things up by attr_accessible
or to turn off the default functionality that blocks mass-assignment. But I want to keep whatever security that setting implies. I don't want these entries to be edited once they've been seeded. I just need to put these into the database first.
What am I not seeing here? How do I seed these data without turning off protection? It seems like seeds should be a special case, allowing mass-assignment where it's otherwise not permitted.