Closed universal closed 6 years ago
using janko-m/sinatra-activerecord might be the more logical choice...
Switching to sinatra-activerecord isn't complicated and reduces the number of gems required "from" rails. I've created a branch for that based off this one.
I've so far only run the specs, but haven't tested against the browser client. The specs are passing now. I'll manually check the browser plugin next.
If someone wants to give it a try, I highly suggest not doing it in a production env!
bundle --with migrate
# the following will migrate the development.sqlite3 file to the "ar-format"
# it will backup the original file to development.sqlite3.CURRENT_TIMESTAMP
ruby tools/migrate_to_ar.rb -e development
env RACK_ENV=development ALLOW_SIGNUPS=1 bundle exec rackup -p 4567 config.ru
This should now be complete, some further testing would be very much appreciated! I checked it against my database and it seems to work fine and the firefox and chrome browser clients. I currently don't have a mobile device handy for testing.
Proper handling of Identies and Cards depends on #47.
@jcs any feedback on this? If you don't want to integrate this, that is totally fine with me, but at least some comment would be nice :-) If you are busy with other stuff and can't look at it right now, I don't mind keeping it open for as long as it takes.
If you fix the merge conflicts I can try it out. I'm not opposed to switching to AR, there is just a ton of stuff in your PRs (this one and #52) so I don't know what is done and what you're still working on.
This one is just switching to using active-record. The other one is all the additional stuff like attachments etc... I will fix the merge conflicts and ping you again when i'm done :-)
@jcs I updated the commits. It should now merge just fine. I also added the sinatra-active-record commit to this pull-request, since I feel this is the more logical choice.
Seems to work here with some minor changes, I'll clean those up after merging.
Thanks for all the work involved in this.
see also #43 , just for simplification I copy the text I wrote there, the ticket can probably be closed:
I'm currently having a look at bringing in activerecord for the db stuff. It would open up the possibility to easily use other db systems. It would also probably simplify serializing data to and from the db in json format.
Some questions came up:
serialize :some_field
helper from rails is used and a dedicated json serializer is added?Current status:
Further refactorings
Open Questions