Trying to understand how to use MySQL stored procedures with existing
class/resources. So, for example, i have a class 'Song'. And i need to
increase counters and make some routines after this song being played.
I dont need to reload object, just execute operations on existing
object. Let`s name this function 'add_play'.

class Song
    include DataMapper::Resource
    property :id, Serial
    property :some_value, String

    def add_play(user_id=0)
          need_to_execute_stored_procedure_here(self.id, user_id)
    end
end

So, basically i have stored procedure that inserts data into multiple
tables (one transaction).
Can anybody explain (or show example) how to use procedures with
DataMapper?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to