Indeed - only by manually overriding the primary key methods do I get
something working:

```
  def self.primary_key
    :id
  end

  def self.primary_key_hash(value)
    {:id => value}
  end
```

Ideally this should be assumed from set_primary_key?  Is this a bug?

On Fri, Mar 6, 2015 at 11:20 PM, Jeremy Evans <[email protected]>
wrote:

> On Friday, March 6, 2015 at 12:52:32 PM UTC-8, Neil Middleton wrote:
>>
>> Actually, most of this seems solvable by liberal use of `primary_key` and
>> `left_primary_key` on the associations.  Whilst I can now read from the
>> database there are still the odd things related to PKs:
>>
>> ```
>> Sequel::Error: No primary key is associated with this model
>>
>
> This is what set_primary_key should fix.  Are you sure you called
> set_primary_key on all of the models that are backed by views?  Note that
> it doesn't hurt to set them on models backed by tables, though Sequel can
> usually determine that information from the database.
>
> Thanks,
> Jeremy
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sequel-talk" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sequel-talk/WamdFeH0wGQ/unsubscribe.
> To unsubscribe from this group and all its topics, 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/sequel-talk.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
 - N

-- 
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 http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to