My current application is for picture albums. These picture albums are
oraganized/created as per the location. I am just doing it for my
learning purpose. I am trying to make a user management plugin for it.
The basic application worked with no plugin is working fine.
Initially I had models like this:
class Album < ActiveRecord::Base
validates_presence_of :title, :state_id
class Photo < ActiveRecord::Base
class State < ActiveRecord::Base
validates_presence_of :name, :country_id
class Country < ActiveRecord::Base
class User < ActiveRecord::Base
validates_presence_of :username, :password_hash, :password_salt,
class Role < ActiveRecord::Base
Now for making a plugin I placed my user, role, state, country model in
the vendor/plugins/user_test/lib/app/models directory. However, placing
entire model class in the plugins/models directory may not work. Since
tomorrow the application could be for songs related to particular
location. So for the state model placing this line
plugins/models/state.rb- ‘has_many albums’ does not make any sense.
So can I place part of my model definition in the plugin and then one
can modify the albums and state models. This is not a good idea
though… Basically I don’t know how should I proceed given this
situation. Any help?
MaurÃcio Linhares wrote:
And what`s the problem?
Doing it is quite straightforward after you have the list of timezones
based on states
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
On Sat, Feb 21, 2009 at 10:39 PM, Amita B.