Git Product home page Git Product logo

Comments (9)

drcrck avatar drcrck commented on May 25, 2024 1

Hi Daniele :)
With previous version i just workaround in this way :

constructor TeMYACTIVERECORDCreate;
begin
  inherited;
  Self.fTableMap.fTableName := CRRECT_TABLE_NAME ; 
end;

I tried now woth your new idea , and it works well :)
It's more transparent solution, thanks :) :)

from delphimvcframework.

danieleteti avatar danieleteti commented on May 25, 2024

TableName Is now read-only, as you noticed. What we're trying to add is to pass the TableName as (optional) constructor parameter. Does this solve your issue?

from delphimvcframework.

drcrck avatar drcrck commented on May 25, 2024

mm, no not really :(
because now it can works well with TMVCActiveRecordController without any external parameters.

from delphimvcframework.

danieleteti avatar danieleteti commented on May 25, 2024

Can you explain your latest comment? The parameter is an addition to the current behavior, so what work today will continue to work.

The ratio will be: if no parameter is provided through the constructor, the behavior is completely the same as today. If a parameter is provided then the MVCTable attribute is ignored and the actual TableName is the one provided in the parameter.

from delphimvcframework.

drcrck avatar drcrck commented on May 25, 2024

because my code is inside all my ActiveRecord classes, in the constructor!
but , maybe, I can access directly to fTableMap.fTableName :) i see now "fTableName " is public and no more private :)

from delphimvcframework.

danieleteti avatar danieleteti commented on May 25, 2024

I'm working on a solution valid for all the cases. PLease, wait for an update and redo your tests, please.

from delphimvcframework.

danieleteti avatar danieleteti commented on May 25, 2024

Please, update the repo and check hot the GetCustomTableName method works.
d68b102#diff-ccd4b1a1370e0101769b2624049548af36e8e3d55d736864033aa16ba06019a0R149

TMVCActiveRecord.GetCustomTableName allows to overwrite the tablename defined in the MVCTableName attribute. Just overwrite the method in descendant classes and return the tablename to use for the current instance.

from delphimvcframework.

danieleteti avatar danieleteti commented on May 25, 2024

any news?

from delphimvcframework.

danieleteti avatar danieleteti commented on May 25, 2024

Great! Thank you for your feedback

from delphimvcframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.