Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord for CodeIgniter: Rails-style model interactions
#97

[eluser]beemr[/eluser]
I think you might be missing the point of libraries such as these. The standard mantra is "convention over configuration", so the value is placed on opinionated direction rather than open flexibility. In your example, the naming is not true to the spirit of the convention.
If you consider your "categories" table as an object based on its model "Category", you wouldn't want to use the same name for your column. The object name of that column would be a redundant "Category.category".
However, if you accept the convention that object names should have sensible meaning, you would simply name the column "name", so that you could call it as "Category.name" which gives your code clarity for the small price of a simple naming convention.


Messages In This Thread
ActiveRecord for CodeIgniter: Rails-style model interactions - by El Forum - 03-28-2008, 09:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB