def read_associations_configuration
      [:has_one, :has_many, :belongs_to].each do |relation|
        if @config.keys.include? :"#{relation}"
          raise "Invalid #{relation} value" if not [Hash, Array, Symbol].include? @config[:"#{relation}"].class

          # We change the user format (Hash, Array or only one element) to Array
          if @config[:"#{relation}"].kind_of? Hash
            list_models = @config[:"#{relation}"].keys
          elsif @config[:"#{relation}"].kind_of? Array
            list_models = @config[:"#{relation}"]
            # Transform the array of model in a hash with his configuraion (empty, default values)
            @config[:"#{relation}"] = {}
            list_models.each do |model|
              @config[:"#{relation}"][model.to_sym] = {}
            end
          else
            list_models = [@config[:"#{relation}"]]
            # Transform the array of model in a hash with his configuraion (empty, default values)
            @config[:"#{relation}"] = {}
            list_models.each do |model|
              @config[:"#{relation}"][model.to_sym] = {}
            end
          end

          # Iterate inside the array and get and create the configuration to that relationship
          list_models.each do |model|
            # If the user set some configuration (:class_name for example), we use it
            if @config[:"#{relation}"][model.to_sym].kind_of? Hash
              config = @config[:"#{relation}"][model.to_sym]
            # If not, we create it
            else
              # Change sybol of the class name to hash configuration
              @config[:"#{relation}"][model.to_sym] = {}
              config = {}
            end

            # We set the default class_name if is not seted
            if config[:class_name].nil?
              @config[:"#{relation}"][model.to_sym][:class_name] = model.to_s.classify
            else
              @config[:"#{relation}"][model.to_sym][:class_name] = config[:class_name]
            end

            # If the association is belongs_to, we need to define the columns
            if relation.to_s == "belongs_to"
              if config[:polymorphic] == true
                @config[:columns][ :"#{model}_id" ] = { :type => :integer }
                @config[:columns][ :"#{model}_type" ] = { :type => :string }
              else
                @config[:columns][ config[:foreign_key] || :"#{model}_id" ] = { :type => :integer }
                @config[:"#{relation}"][model.to_sym][:foreign_key] = config[:foreign_key] || :"#{model}_id" if @config[:"#{relation}"][model.to_sym][:foreign_key].nil?
              end
            end
            # TODO: Continue adding rails features like:
            #       :autosave
            #       :class_name
            #       :conditions
            #       :counter_cache
            #       :dependent
            #       :foreign_key
            #       :include
            #       :polymorphic
            #       :readonly
            #       :select
            #       :touch
            #       :validate
          end
        end
      end
    end
def read_associations_configuration
      [:has_one, :has_many, :belongs_to].each do |relation|
        if @config.keys.include? :"#{relation}"
          raise "Invalid #{relation} value" if not [Hash, Array, Symbol].include? @config[:"#{relation}"].class

          # We change the user format (Hash, Array or only one element) to Array
          if @config[:"#{relation}"].kind_of? Hash
            list_models = @config[:"#{relation}"].keys
          elsif @config[:"#{relation}"].kind_of? Array
            list_models = @config[:"#{relation}"]
            # Transform the array of model in a hash with his configuraion (empty, default values)
            @config[:"#{relation}"] = {}
            list_models.each do |model|
              @config[:"#{relation}"][model.to_sym] = {}
            end
          else
            list_models = [@config[:"#{relation}"]]
            # Transform the array of model in a hash with his configuraion (empty, default values)
            @config[:"#{relation}"] = {}
            list_models.each do |model|
              @config[:"#{relation}"][model.to_sym] = {}
            end
          end

          # Iterate inside the array and get and create the configuration to that relationship
          list_models.each do |model|
            # If the user set some configuration (:class_name for example), we use it
            if @config[:"#{relation}"][model.to_sym].kind_of? Hash
              config = @config[:"#{relation}"][model.to_sym]
            # If not, we create it
            else
              # Change sybol of the class name to hash configuration
              @config[:"#{relation}"][model.to_sym] = {}
              config = {}
            end

            # We set the default class_name if is not seted
            if config[:class_name].nil?
              @config[:"#{relation}"][model.to_sym][:class_name] = model.to_s.classify
            else
              @config[:"#{relation}"][model.to_sym][:class_name] = config[:class_name]
            end

            # If the association is belongs_to, we need to define the columns
            if relation.to_s == "belongs_to"
              if config[:polymorphic] == true
                @config[:columns][ :"#{model}_id" ] = { :type => :integer }
                @config[:columns][ :"#{model}_type" ] = { :type => :string }
              else
                @config[:columns][ config[:foreign_key] || :"#{model}_id" ] = { :type => :integer }
                @config[:"#{relation}"][model.to_sym][:foreign_key] = config[:foreign_key] || :"#{model}_id" if @config[:"#{relation}"][model.to_sym][:foreign_key].nil?
              end
            end
            # TODO: Continue adding rails features like:
            #       :autosave
            #       :class_name
            #       :conditions
            #       :counter_cache
            #       :dependent
            #       :foreign_key
            #       :include
            #       :polymorphic
            #       :readonly
            #       :select
            #       :touch
            #       :validate
          end
        end
      end
    end
Read all model relationships like belongs_to and has_many