Ticket #310 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] merb_sequel

Reported by: ra..@iprobot.com Assigned to:
Priority: major Milestone: 0.4.2
Component: Plugin: Sequel Keywords: sequel merb_sequel ORM
Cc:

Description

Seems sequel changed ? running sequel (0.3.4.1) with merb Rev: 985 and merb_sequel 0.4.1, console complains about not having a dataset ... the diff below demonstrates a fix by adding a return for DB from Merb::Orms::Sequel and when generating a Model calling the db method to set a dataset for the model. Please observe the diff only demonstrates a fix while running sqlite file based . and are prolly needed for mysql and pg as well, unless it can be solved elsewise ...

Attachments

merb_sequel.diff (1.3 kB) - added by ra..@iprobot.com on 11/15/07 16:45:56.
demonstration of possible fix …
fix_for_sequel_plugin.diff (1.3 kB) - added by has.s..@gmail.com on 11/15/07 17:43:37.
merb_sequel-model-and-migration-fix.diff (1.6 kB) - added by ra..@iprobot.com on 11/16/07 12:22:07.
fixes model syntax adds a require to base64 and do create or recreate table in migration depending on ENV
merb_sequel_model_and_migration_fix.diff (1.6 kB) - added by ra..@iprobot.com on 11/17/07 00:19:33.

Change History

11/15/07 16:45:56 changed by ra..@iprobot.com

  • attachment merb_sequel.diff added.

demonstration of possible fix ...

11/15/07 17:43:14 changed by has.s..@gmail.com

Attached is a patch that fixes an apparent bug with the generators, sessions, and models. It seems that an empty migration cannot run, and also that a table must be explicitly set in the model.

These issues need to be checked with the sequel crew.

11/15/07 17:43:37 changed by has.s..@gmail.com

  • attachment fix_for_sequel_plugin.diff added.

11/15/07 18:14:12 changed by ra..@iprobot.com

k - i think it is the generation code that has the wrong syntax !!!

now generates :

class Blog < Sequel::Model

end

should generate :

class Blog < Sequel::Model(:blogs)

end

so the below fixes it :

class <%= class_name %> < Sequel::Model(:<%= class_name.snake_case.pluralize %>)

end

cheers

11/16/07 12:16:58 changed by ra..@iprobot.com

Here is a new diff that should massage merb_sequel to a working state ...

Please notice the anamolies when :

script/generate model topic

script/destroy model topic

the generated schema/migrations/004_add_model_topics.rb is reported missing and are not deleted.

Then is there a way to not loading & connecting to the DB when generating/destroying ? :

script/destroy model topic Started merb_init.rb ... Connecting to database... Loading Application... Compiling routes.. Loaded DEVELOPMENT Environment...

thanxs

11/16/07 12:22:07 changed by ra..@iprobot.com

  • attachment merb_sequel-model-and-migration-fix.diff added.

fixes model syntax adds a require to base64 and do create or recreate table in migration depending on ENV

11/17/07 00:19:33 changed by ra..@iprobot.com

  • attachment merb_sequel_model_and_migration_fix.diff added.

11/22/07 14:10:46 changed by has.s..@gmail.com

  • status changed from new to closed.
  • resolution set to fixed.

(In [1034]) Fixes some bugs with the migration and model generators. Also fixes some issues with the sessions. Thanx ra..@iprobot.com Closes #310