On Oct 1, 9:13 am, Simon Arnaud <[email protected]> wrote:
> Hi
>
> I was wondering if there was a way to create a model which does not map all
> attributes of a table ?
>
> something like :
>
> Class Person < Sequel::Model
> ignore_attribute :phone, :mail
> end
Class Person < Sequel::Model
self.dataset = dataset.select(...) # ... being all columns
except :phone and :mail
end
Alternatively, you can use the lazy_attributes plugin,
Class Person < Sequel::Model
plugin :lazy_attributes, :phone, :mail
end
That won't select phone and mail by default, but if you call the phone
or mail accessor methods, it will load the values on demand from the
database.
Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" 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/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---