I am still trying to get a trivial web site up where the individual
users have no connection with each other (an overriding requirement).
Matt Jones helped with my first problem (separating the data at creation
time) as shown below with his reference to #creator. Unfortunately,
each user sees "stuff" which can be connected to other users as follows:
Users create log entries which are their business only. When looking at
the log entries, User 1, who has entered 2 log entries and User 2, who
has entered 1 log entry see log entry tabs as follows:
(for User 1):
There are* 3 *Log Entries: *<< but he only made two entries*
Log Entry *1*
User 1
Log Entry *3 << what happened to entry 2?*
User 1
(for User 2):
There are *3* Log Entries* << but she only made one entry*
Log Entry *2 << what happened to entry 1?*
User 2
In both cases, the individual users can tell that there are other users
and which Log Entries have been assigned to them..
I would like the individual users to have separate counts and ind ices
for their own log entries.
Is this a bug? If not, can anyone recommend a work-around so I can meet
my requirements?
Thanks,
Don Ziesig
On Mar 15, 2010, at 5:25 PM, donz wrote:
I am trying to implement a very common pattern - (almost) all data are
owned by a particular user and no other users should be able to see/
change it. The normal way I would do this in rails is to set the
user_id in the owned data model before creating the record - which is
what I think this thread is discussing.
Using Hobo 1.0, I tried a very simple example of this, two tables
Users and LogEntries. in the log_entry model I tried to access
acting_user in various ways and all I get is "you dummy, you are
trying to access nil.id .....". puts "#{acting_user}" >> nil
Right - acting_user is only set on the model during a create or a save;
it's available in the various validation methods, permission methods and
callbacks, but not typically set outside that context.
Since I am new to hobo, and this list, let me ask some dumb
questions. Is this the right list for asking these kind of questions
(I hit the bug list first and got a rocket in reply)? Since I can't
access acting_user in the model, should I presume that this discussion
is preliminary to making it available? Is there some other example of
this design pattern? (I have looked in the various manuals/examples
and not found the a starting place).
Heh - this may be a case of there not being enough "there" there to
merit much documentation. The use case you're describing is indeed
common, common enough that it's been absorbed as a model extension:
http://cookbook.hobocentral.net/manual/model#creator
Hope this helps!
--Matt Jones
--
You received this message because you are subscribed to the Google
Groups "Hobo Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.