Hi there,
I'm running into a spot of bother with an engine I'm developing.  I want
the table names I'm using to be configurable by the end user, such that
nothing is hard coded.  Having looked through user_engine, I see it
makes use of things like: UserEngine.config(:some_table).  I'm trying
todo the same thing, like in the following:

 has_many :mac_user_grants, :class_name => 
MacEngine.config(:mac_user_grant_table)

But when i come to use the class this is in I get an error like the
following: 

NameError: undefined local variable or method `mac_user_grants' for MacAcl:Class

in my mac_engine.rb file, I have the following:

module MacEngine
        if ActiveRecord::Base.pluralize_table_names
                config :mac_user_grant_table, "mac_user_grants"
        else
                config :mac_user_grant_table, "mac_user_grant"
        end
end

I'm guessing the problem lies with how/what
MacEngine.config(:mac_user_grant_table) returns, and how it gets
interpreted.

I've tried the following to no avail:

:class_name => "#{MacEngine.config(:mac_user_grant_table)}"
:class_name => MacEngine.config(:mac_user_grant_table).to_s

So my question is, and its probably more of a general Ruby question than
an engines one, what is :class_name expecting, and how can i provide it?


-v

-- 
keys:  http://codex.net/gpg.asc 

 Mankind must put an end to war, or war will put an end to mankind
 -- JFK 

_______________________________________________
engine-developers mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org

Reply via email to