Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About this project and Sequel way #20

Open
kuraga opened this issue Dec 12, 2016 · 3 comments
Open

About this project and Sequel way #20

kuraga opened this issue Dec 12, 2016 · 3 comments

Comments

@kuraga
Copy link
Collaborator

kuraga commented Dec 12, 2016

P.S. Now I see that our project isn't so brilliant... It violates Sequel way...

Just for instance. See here:

collection_singular    = singularize(collection_name.to_s).to_sym
collection_singular_id = :"#{collection_singular}_id"
through_klass          = constantize(singularize(camelize(through.to_s)))
<...>
:adder => proc do |many_of_instance|
     through_klass.create(collection_singular_id => many_of_instance.pk, able_id => pk, able_type => self.class.to_s)
end

And in Sequel:

lcks = opts[:left_keys] = Array(left)
lcpks = opts[:left_primary_keys] = Array(left_pk)
def _join_table_dataset(opts)
    ds = model.db.from(opts.join_table_source)
    opts[:join_table_block] ? opts[:join_table_block].call(ds) : ds
end
<...>
opts[:adder] ||= proc do |o|
      h = {}
      lcks.zip(lcpks).each{|k, pk| h[k] = get_column_value(pk)}
      rcks.zip(opts.right_primary_key_methods).each{|k, pk| h[k] = o.get_column_value(pk)}
      _join_table_dataset(opts).insert(h)
end

Just feel the difference and incompatibilities...

@jackdempsey

This comment has been minimized.

@kuraga
Copy link
Collaborator Author

kuraga commented May 10, 2019

And seems like all of these don't work properly, see #32, https://groups.google.com/forum/#!topic/sequel-talk/Ukb8APwWtWY

@kuraga
Copy link
Collaborator Author

kuraga commented May 10, 2019

I marked gem unmaintained in 2bbaa36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants