rails, dynamic tables and erp/crm

the question that could summarize this in a nutshell is this:

does the orm structure of rails make it a poor framework to implement a small erp/crm solution?

if you got that then please read ahead - i need some suggestions...

ive been making an app for my small business. now believe me, i know there's a ton of solutions out there but coding is more like a recreational activity so i enjoy doing it regardless...

my program has the basic ability to generate quotes, track my inventory and all the basic functions however i'm finding it more and more difficult to make it extensible.

for example - i have a customer model (to put it simply) and say i want to add an TaxID column... i can use migrations and update all of my forms and blah blah blah... most "good" crm programs allow you to add this functionality on the fly - i would like to add that functionality.

don't get me wrong - i dont care about the UI design and javascript thats involved... that's all secondary to me. i want to know at the model/controller level if this sort of thing is not only possible but probable with rails. (by "this sort of thing" i mean dynamically creating/altering models on the fly with a running app).

Thanks in advance - hopefully someone with deep insight will step up to the plate for me. I've asked around and i've yet to receive anything that looks like a helpful answer.

have a look into sugar crm - where u can create columns as needed. they store it in a predefined table...have look - its worthwhile. havent done it in rails, unfortunately - but its on the plan. but keep us updated! tom

fat-free-crm is good code base.http://www.fatfreecrm.com/

Frank--

Take a look at http://friendlyorm.com/. That sounds like what you need... You can then evolve your data models on the fly.

Or you could do something like create a CustomField model and make your User model so that it 'has_many' custom fields. You could even make it bi-directional and your CustomField has_many Users.

Hope that helps.

--Mark

i didnt understand "friendly", but a CustomField-Models is similar to what i said is sugar-crm doing....and u can do the same in rails. only the views needs to be adapated / can b cumbersome, unless someone has a solution for that. to me, i do more flex and have all custom fields in a simple datagrid

frankjmattia@gmail.com wrote:

the question that could summarize this in a nutshell is this:

does the orm structure of rails make it a poor framework to implement a small erp/crm solution?

No. It should be fine.

if you got that then please read ahead - i need some suggestions...

ive been making an app for my small business. now believe me, i know there's a ton of solutions out there but coding is more like a recreational activity so i enjoy doing it regardless...

my program has the basic ability to generate quotes, track my inventory and all the basic functions however i'm finding it more and more difficult to make it extensible.

for example - i have a customer model (to put it simply) and say i want to add an TaxID column... i can use migrations and update all of my forms and blah blah blah... most "good" crm programs allow you to add this functionality on the fly - i would like to add that functionality.

If you want arbitrary user-defined columns, check out the serialize method.

You could also have the app change the DB schema programmatically, but that sounds dangerous.

don't get me wrong - i dont care about the UI design and javascript thats involved... that's all secondary to me. i want to know at the model/controller level if this sort of thing is not only possible but probable with rails. (by "this sort of thing" i mean dynamically creating/altering models on the fly with a running app).

Yes!

Thanks in advance - hopefully someone with deep insight will step up to the plate for me. I've asked around and i've yet to receive anything that looks like a helpful answer.

Best,

well i'd like to thank everyone who's given me some responses. i've looked at all the precooked solutions that were suggested but what it really boils down to is i enjoy the programming challenge and i'm still not convinced i need/want to switch all the data in my app to someone elses app. it just isnt worth it for my needs.

im going to look deeper into using serialize but what i really wanted was the full abilities of rails for validations, callbacks, etc...

in any event.. thanks for the input guys, it was much appreciated.

- FJM

frankjmattia@gmail.com wrote:

well i'd like to thank everyone who's given me some responses. i've looked at all the precooked solutions that were suggested but what it really boils down to is i enjoy the programming challenge and i'm still not convinced i need/want to switch all the data in my app to someone elses app. it just isnt worth it for my needs.

Well, there is something to be said for not reinventing the wheel. On the other hand, if you can build a better wheel, do it!

im going to look deeper into using serialize but what i really wanted was the full abilities of rails for validations, callbacks, etc...

You can have that in any Rails app. Serialization is not relevant to that.

Now, it's true that serialization can be abused. You want to make sure that you separate fields as much as possible if you know that they're going to be separate. But it's great for dynamic user-defined attributes.

in any event.. thanks for the input guys, it was much appreciated.

- FJM

Best,

i guess what i meant to say was that if i created a user-defined column then i (through some magical UI controls which i'd eventually throw together) would like to be able to say is "this column is an integer.." and when i use that new user defined column it gets the full benefits of validates_numericality_of ... user_column_1.. what i was driving at was if i create a serialized column and create pseudo- fields inside of that then theres no way to get baked in validations and i'd end up creating my own validation functions.

im sure this sort of thing is possible but im thinking its going to be a lot of trouble... hopefully nt more than its worth.

however, if i can invent a better wheel i'd love to share it with the world... so that kinda urges me to push forward.

frankjmattia@gmail.com wrote:

i guess what i meant to say was that if i created a user-defined column then i (through some magical UI controls which i'd eventually throw together) would like to be able to say is "this column is an integer.." and when i use that new user defined column it gets the full benefits of validates_numericality_of ... user_column_1.. what i was driving at was if i create a serialized column and create pseudo- fields inside of that then theres no way to get baked in validations and i'd end up creating my own validation functions.

Not really true AFAIK. While I've never done this with serialized fields, I don't believe Rails should have much trouble validating on virtual or serialized attributes as if they were DB fields.

im sure this sort of thing is possible but im thinking its going to be a lot of trouble... hopefully nt more than its worth.

I think you're anticipating more trouble than you'll actually have.

however, if i can invent a better wheel i'd love to share it with the world... so that kinda urges me to push forward.

Good luck!

Best,

this might be worth a look : http://codaset.com/codaset/codaset/blog/create-schema-less-dynamic-model-attributes