You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActiveRecord::Wrapper has some kind of built-in implementation for providing oai-pmh "sets".
But it is non-documented, and very confusing. It seems to be based on assuming that you will organize your records into sets using an actual rdbms fk/pk association (and corresponding ActiveRecord association), and/or with a String "set" column/attribute in your record table.
This seems not flexible enough, and making too many assumptions. The code is also somewhat convoluted, making lots of assumptions about your Models and making guesses. I was unable to figure out how to make tests even exersizing some paths in the code.
We should deprecate all the existing "set" stuff. And provide a new set implementation where the sets are defined on the Wrapper, rather than making assumptions about the model. They can probably conveniently make use of ActiveRecord "scopes" (methods that return relations) for the simple cases.
It should not require any additional methods (or db attributes/relationships) be added to your AR models, you should do the configuration in the wrapper class (and/or a custom sub-class of the wrapper class?)
ActiveRecord::Wrapper has some kind of built-in implementation for providing oai-pmh "sets".
But it is non-documented, and very confusing. It seems to be based on assuming that you will organize your records into sets using an actual rdbms fk/pk association (and corresponding ActiveRecord association), and/or with a String "set" column/attribute in your record table.
This seems not flexible enough, and making too many assumptions. The code is also somewhat convoluted, making lots of assumptions about your Models and making guesses. I was unable to figure out how to make tests even exersizing some paths in the code.
See eg https://github.com/code4lib/ruby-oai/blob/master/lib/oai/provider/model/activerecord_wrapper.rb#L91-L118
We should deprecate all the existing "set" stuff. And provide a new set implementation where the sets are defined on the Wrapper, rather than making assumptions about the model. They can probably conveniently make use of ActiveRecord "scopes" (methods that return relations) for the simple cases.
It should not require any additional methods (or db attributes/relationships) be added to your AR models, you should do the configuration in the wrapper class (and/or a custom sub-class of the wrapper class?)
This will probably not be done before 1.0.
See #9, #49, #66.
The text was updated successfully, but these errors were encountered: