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

Extension Approach 1 and 2, only allow to add to schema. #53

Open
nimish-mehta opened this issue Apr 11, 2016 · 0 comments
Open

Extension Approach 1 and 2, only allow to add to schema. #53

nimish-mehta opened this issue Apr 11, 2016 · 0 comments

Comments

@nimish-mehta
Copy link

nimish-mehta commented Apr 11, 2016

Right now in extension approach 1 and 2 we can only add to existing schema via

add_to_schema do
  # schema declarations to add go here
end

and then we use it like this in models.

schema "source" do
  original fields & relations
  extensions
end

While this is simple, it does not allow us to remove/modify existing relations.

What we can try and do is use something like this in models:

extended_schema "source" do
  original fields & relations
end

and then provide two methods:

add_to_schema do
end

remove_from_schema do
end

using this we can rewrite the schema call.

see initial implementation here and diff

This could allow us to add/remove fields to schema, however we want to be sure before implementing this whether we want to include this feature as it may cause things to break if used with abandon, i.e. compile time pattern matching fails or essential fields used throughout the system being removed.

@nimish-mehta nimish-mehta changed the title Extension Approach 1 and 2, Only allow to add to schema. Extension Approach 1 and 2, only allow to add to schema. Apr 11, 2016
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

1 participant