Search code examples
ruby-on-railsruby-on-rails-3ruby-on-rails-4filemaker

RoR and Filemaker Where condition


Not sure if this is possible, but I am wondering if I can compare two fields in a where As I am trying to avoid if statements in this case.

For example:

Article.where(clidlive: '*', "#{mod_date} > "#{releae_date})
  • mod_date is a date field in filemaker
  • releae_date is a date field in filemaker.

I'd really appreciate if you could direct me to the right path, or even this is possible.

Thanks, Rob


Solution

  • Short answer: No

    Longer answer: Rails has no knowledge of filemaker or its records until you point Rails to FM. You can use this gem to do so: https://github.com/ginjo/rfm

    Once you parse the data you could store it in SQL to use ActiveRecord query methods in the style you listed above:

    Article.where.not(clidlive: nil).where("mod_date > ?", release_date)

    You could also create a calculation on the filemaker side and just query that field. Hope that helps!