Hi Jeremy,
I have a "Dir" Model (dirs table) and I do some joins when i fetch data
from it.
For example:
dir = Dir.select{ dirs.* }.select_append(Sequel[:paths][:pid])
.join(:paths, id: path_id).where(name: 'My Dir')
.first
As you can see, I get all fields/columns from `dirs` table and also one
more field from `paths` table called `pid`.
Problem is, when I change something on this result and call `save`, Sequel
says `pid` is npot available on `dirs` table. Of course, pid is belongs to
paths table.
So my question is how can I exclude "pid" field when I save this mode? See:
dir = Dir.select{ dirs.* }.select_append(Sequel[:paths][:pid])
.join(:paths, id: path_id).where(name: 'My Dir')
.first
dir.name = 'My New Dir'
dir.save # Error: "pid" is not in "dirs" table.
Is it possible to filter "pid" before save/update?
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/507e55d8-e204-4e4b-9dba-b78823175f5fn%40googlegroups.com.