El Martes, 19 de febrero de 2013 07:39:45 Atastor escribió: > Can somebody give me a rough idea of a scenario, where one would profit > from using AS with a tableless model? > > Naively spoken, all the advantages of AS are somehow related to dealing > with huge numbers of objects; huge number of objects I use to get from > database tables. So iff I dont have a database, how do I get the huge > number of objects necessary (?) to use AS in a sensible way? > > Regards > Michael
You need to mimic ActiveRecord::Base in your tableless models. You can inherit from ActiveScaffold::Tableless, create the column objects (column definitions) and implement find_all and find_one class methods and destroy instance method. In find_all and find_one you can check conditions passed to where method in relation argument: class TablelessModel < ActiveScaffold::Tableless column :id, :int column :name, :string self.primary_key = :id def self.find_all(relation) end def self.find_one(id, relation) end def destroy end end -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/activescaffold?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
