Giter Club home page Giter Club logo

filemaker-ruby's People

Contributors

corwinstephen avatar gingermusketeer avatar mech avatar slyfox42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

filemaker-ruby's Issues

belongs_to doesn't seem to function properly

Hopefully there's not something I'm missing here, but it seems that the belongs_to relationship doesn't work.

I have a model Project and a join model called ProjectMember. ProjectMember has a project_id and I've specified that ProjectMember belongs_to :project. Project defines integer :id, identity: true.

When I run ProjectMember.first.project, I get: Filemaker::Errors::FindCriteriaEmptyError: 400 (Find criteria are empty)

Thoughts?

Editing records

Hi, I'm having an issue updating records on Filemaker. This is my controller:

# frozen_string_literal: true

# Api::V1::TechniciansController
module Api
  module V1
    class TechniciansController < Api::V1::BaseController
      before_action :authenticate!

      def show
        @technician = FM::Technician.equals(id: params[:id]).first
        render json: @technician, status: :ok
      end

      def update
        @technician = FM::Technician.equals(id: params[:id]).first
        @technician.auth_token = params[:authToken]
        @technician.save!
      end
    end
  end
end

and this is the model:

# frozen_string_literal: true

module FM
  class Technician
    include Filemaker::Model

    database 'Interventi_Test'
    layout 'Tecnici Autorizzati'

    integer :id, fm_name: 'ID'
    string :name, fm_name: 'Nome'
    string :apple_id, fm_name: 'AppleId'
    string :auth_token, fm_name: 'AuthToken'

    def attributes
      ::TechnicianAttributes.perform(self)
    end

    def as_json(options = {})
      ::TechnicianAttributes.perform(self).as_json(options)
    end

    def to_json(options = {})
      ::TechnicianAttributes.perform(self).to_json(options)
    end
  end
end

I made sure that the user has full write and read access on the filemaker database, but for some reason when invoking the save! method, the changes aren't persisted to the database.

I can see the changes are made on the instance, and save! returns true, however I still see no changes on db.

Could you help me figure out what I'm missing?

Thanks

error with rails

/var/lib/gems/2.4.0/gems/filemaker-0.0.19/lib/filemaker.rb:38:in block (2 levels) in load!': undefined method fetch' for "host.com":String (NoMethodError)

My filemaker.yml :

development:
  host: host.com
  account_name: test
  password: test
  ssl: true
  log: curl

Missing return of fields

I have this really strange issue that I can't figure out on my own:

When I pull data from the XML-interface of FM directly on one layout, The result is like this:

<record mod-id="1480" record-id="6">
<field name="_id">
<data>SU000005</data>
</field>
<field name="_id_Country">
<data>259</data>
</field>
<field name="DaysWorkdaysInWeek">
<data>5</data>
</field>
<field name="ShortName">
<data>ANS</data>
</field>
</record>

My model for that looks (partially) like this:

  string    :supplier_id, fm_name: '_id', identity: true
  string    :country_id, fm_name: '_id_Country'
  string    :shortname, fm_class: 'ShortName'
  string    :workingdays, fm_class: 'DaysWorkdaysInWeek'

But when I call it, it says nil for the one field (and others that I try to pull like that when I have been playing around to figure it out):
#<Supplier:0x007fb2d0d711a0 @new_record=false, @attributes={"supplier_id"=>"SU000005", "country_id"=>"259.0", "shortname"=>"ANS", "workingdays"=>nil}, @relations={}, @record_id="6", @mod_id="1480", @portals={}>

I only have this problem for one model. Any pointers on what could cause this?

Andreas

Able to search for work month

Would like to be able to pull out records within Aug 2015 like this

Employment.where(hiring: 'Active', expired_at: '8/2015')

clear_changes_information

Hi,

Not sure if relevant or not ... but after upgrading to filemaker-ruby 1.0, we had to include public :clear_changes_information on all the models in order to make the app work.

Container url

Hello,

First of all - thanks for you work on this great gem!

I need to get the URL of a container field, but can't find any functionality for it. Could this be added?

BR,
Andreas Lydersen

`where` isn't properly searching records

My member class includes Filemaker::Model and defines string :email, however:

Member.where(email: '[email protected]').count returns 0 despite the fact that the email is verified in the db table. Running member.not(email: '[email protected]') returns all records, including the one I'm looking for.

Searching instead for a member id (an integer field) works fine.

Thoughts?

Update nokogiri dependency

nokogiri dependency should be updated to get rid of vulnerability alerts.

This is the result of the audit from ruby-advisory-db on my code using filemaker-ruby.

Name: nokogiri
Version: 1.10.1
Advisory: CVE-2019-11068
Criticality: Unknown
URL: https://github.com/sparklemotion/nokogiri/issues/1892
Title: Nokogiri gem, via libxslt, is affected by improper access control vulnerability
Solution: upgrade to >= 1.10.3

Vulnerabilities found!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.