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
Rework #34
Conversation
@AMHOL @cflipse @flash-gordon @timriley ding dong, please check this out. I'd love to get it done and add a couple features (associations mostly and a built-in json adapter specialization) on top of this rework. |
Looks okay so far |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're still good at programming
lib/rom/http/relation.rb
Outdated
|
||
require 'rom/http/attribute' | ||
require 'rom/http/schema/dsl' | ||
require 'rom/http/schema/dsl' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repetitive require
lib/rom/http/relation.rb
Outdated
else | ||
:id | ||
end | ||
schema.primary_key[0].name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can have a missing method here, mb it's a good idea to raise a meaningful exception
* Add HTTP::Schema and HTTP::Attribute * Add custom HTTP::MapperCompiler * Remove manual transformations in favor of auto-mapping feature from core * Simplify some specs * Remove applying transformations in insert/update - this type of functionality is not supported by core and it's actually something we intentionally do not want to have. Input that doesn't match canonical data structures can be handled by changesets with their mappings
* Rely on options exclusively in dataset, remove config idea completely * Remove Dataset#name, use #base_path * Refactor dataset spec using simpler syntax and simpler examples * Change Gateway#dataset to set up a dataset using options based on its config
It's better to have duplication in specs than to make it more complex with more blocks and meta-programming
* Use constants for default values * Use HTTP::Types::Path instead of utility method * Simplify option declarations
I merged this in, feel free to provide further feedback here though, and I'll address it in new PRs or directly in master. |
@solnic can this branch be deleted? |
Summary
Add HTTP::Schema
andHTTP::Attribute
HTTP::MapperCompiler
Dataset
so that it only uses its optionsDataset#name
as it felt like additional complexityDataset::ClassInterface
(we're in beta phase, no need to go through deprecation cycles)Dataset#{get?,post?,put?,delete?}
HTTP::Relation#wrap
as this is now a core method and it does something else