upmin / upmin-admin-ruby

Framework for creating powerful admin backends with minimal effort in Ruby on Rails.
MIT License
757 stars 66 forks source link

[WIP] Customizable uneditable attributes #152

Open tfe opened 9 years ago

tfe commented 9 years ago

No specs yet unfortunately, and it doesn't seem like the primary docs are contained in the repo either.

I would say that the existing test suite runs, but I had a lot of trouble getting it to run. I'd be happy to walk through the issues I ran into with someone offline though.

Mainly I just made this for my own use, but thought I'd toss it back upstream to see if you guys could use it. No worries if not.

tfe commented 9 years ago

Editing this to be a WIP... I found a bug where the presence of this won't let a database be migrated from scratch. An error is thrown during rake db:migrate because upmin tries to create a new instance of the model class, but the table doesn't exist yet.

To fix it, default_uneditable_attributes needs to be accessible without instantiating a new instance. However because of the way the default attributes are currently provided in the ORM adapter, it needs to be instantiated so that the right ORM extensions are included (happens in initialize).