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.
Right now in extension approach 1 and 2 we can only add to existing schema via
and then we use it like this in models.
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:
and then provide two methods:
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.