Hello!

After your changes (optimizations) 
in 
https://github.com/jeremyevans/sequel/commit/8d390da53d8c42be59366a1fd24c49e8cfc84712
 
and 
https://github.com/jeremyevans/sequel/commit/f1bcb9521adb5d9fbb4283e89c40049e4f51603b
 
there is no way to make some hook for instance (initializing) after 
`Model.all` method.

For example, I have `class Locale < Sequel::Model`, and I want to have 
`Locale#i18n`, which find object from (another) global storage and assign 
it to model instance.

So, good approach is:

```ruby
attr_reader :i18n

def code=(value)
  super

  @i18n = I18n.storage.find { |obj| obj.iso_code == value }
end
```

Or maybe:

```ruby
def initialize(*)
  super

  @i18n = I18n.storage.find { |obj| obj.iso_code == code }
end
```

But it doesn't work for `Locale.all`.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to