Closed Hermanverschooten closed 8 years ago
Oh, I started a discussion on the wrong issue.
The loader should be framework-agnostic, models should be in concepts/comment/model.rb
and will be loaded automatically with the current implementation.
Or, actually, wait, hm... Trying to work out if it would make sense to decouple persistence from concepts, because often a concept does not necessarily map to a database table(s), and we could keep the app/models
directory, then.
I'd prefer to keep my models in app/models, to cleanly separate the business logic from the persistence layer. If I understand the pipeline correctly it takes an input, performs some action on it and hands it to the next in the chain. But if you look at the ConceptFiles, it ignores the input, effectively forgetting the output from the inserted FindModels.
I agree on separate directories, I also find `app/controllers quite ok.
Checked on gemgem-trbrb and I get the same problem!
:+1:
I do not know if this should be filed against trailblazer-loader / trailblazer-rails.
The list of files seems to return only the result of the ConceptFiles, and not of a previously injected step. Using the current version (0.0.5) and starting rails console outputs:
The model class:
When I try`
Address.customers
, it returnsNoMethodError: undefined method
customers' for #If I check the input parameter for ConceptFiles, it does contain the list returned by the injected function (from trailblazer-rails), but they are not in the result.
I tried concatenating the input to the result and that works, but I know this is probably not what is needed. But it does add them.