Sha256: aad5a62cba0af01eda10a37093da379257159a45ff79f4e861a1064af8c89e5b

Contents?: true

Size: 958 Bytes

Versions: 36

Compression:

Stored size: 958 Bytes

Contents

module PublishMyData
  module DataCubeController
    extend ActiveSupport::Concern

    included do
      respond_to :json
      before_filter :get_dataset

      private

      def get_dataset
        @dataset = Dataset.find_by_slug(params[:id])
        raise Tripod::Errors::ResourceNotFound unless @dataset.is_cube?
        @cube = @dataset.cube
      end

      def get_pagination_params
        @page = (params[:page] || 1).to_i
        @page = 1 if @page < 1

        @per_page = (params[:per_page] || 500).to_i
        @per_page = 1 if @per_page < 1
        @per_page = 5000 if @per_page > 5000
      end

      def get_dimensions
        @rows_dimension_uri = params[:rows_dimension]
        @columns_dimension_uri = params[:columns_dimension]

        @locked_dimensions = {}

        params.each_pair do |k,v|
          if k.to_s.starts_with?("http://")
            @locked_dimensions[k] = v
          end
        end
      end

    end

  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
publish_my_data-1.3.25 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.24 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.23 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.22 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.21 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.20 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.19 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.18 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.17 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.16 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.15 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.14 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.13 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.12 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.11 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.10 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.9 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.8 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.7 app/controllers/concerns/publish_my_data/data_cube.rb
publish_my_data-1.3.6 app/controllers/concerns/publish_my_data/data_cube.rb