On Nov 18, 4:24 pm, Steve Ross <[email protected]> wrote:
> I have the following code:
>
> database = Sequel.connect('sqlite://lrdb.db')
> puts database.inspect
>
> t = database[:Adobe_images] # <= See if I can get to the table using
> core functionality. Yes!!!
> puts t.first
>
> class Image < Sequel::Model(:Adobe_images) # <= See if I can get to
> the table using model
> end
>
> Image.filter{:fileHeight > 1000}.each do |add| # <= Failure.
This is the only problem I can spot in your code. If you are using a
virtual row block, you should be doing:
Image.filter{fileHeight > 1000}.each do |add|
Note the missing colon. That doesn't explain the weird error you are
receiving though. Could you try removing the colon and posting a full
SQL log (using require 'logger'; database.loggers <<
Logger.new($stdout)) if you still have problems?
> # stackParent____aspectRatioCache,
> # stackParent____captureTime,
> # stackParent____colorLabels,
> # stackParent____fileFormat,
> # stackParent____pick,
> # stackParent____rating,
> # stackParent____touchCount,
> # stackParent____touchTime,
These could potentially cause issues if you attempt to modify a
record, as Sequel treats double/triple underscores in symbols
specially. The easiest way to work around that is to use an
identifier_(input|output)_method that does the translation in and
out. Search the Google Group, I gave an example fairly recently.
You'd probably want to squash the 4 underscores to one in
identifier_output_method, and expand the 1 underscore to 4 in
identifier_input_method, just for those specific identifiers.
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.