pragma-rails 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2296947bedbdc7b81cac15053a92a8d59ecdb276
4
- data.tar.gz: aeece846c1d8717ee920294da0e63f33834ffa93
3
+ metadata.gz: ab9ede65466d1182c761666f6e20910ade9d61f4
4
+ data.tar.gz: 30510d4d09ab978602f2322be02e7ec4b87f2e7a
5
5
  SHA512:
6
- metadata.gz: 2d3ae5a6057b1da3c878db167f310661ec9fcc919427c96036378a2fcec58b8a9a82d5f0e78eac38dd631235056d981b3d2b775b0ef2f0f22156ae7480bf7cce
7
- data.tar.gz: 6348bd9002b966c8b604deffdd4aa6ed41f27d3f036105fc1bae4a9c70f1e58661f3503921c7acafa377c066b00a427506b3d77de2ff2a60282406474724291a
6
+ metadata.gz: ea5e425d9c514718dfaa7a7fb16bc812ad75ebf13160802e37acf9c70f4ac0a5d8336fc11e8856af343807b4131ef1ab080270ffc7a98b4b92355f39fb4d0cf7
7
+ data.tar.gz: 77f19339e72c26fadb0b351b61ebb9770e9b17b41a9afc0d3458de5aff737611325737327d846bd21151687c09fed761e719f6600c6ecbc68a84ceaa0ac17729
@@ -16,7 +16,7 @@ module Pragma
16
16
  # @param operation_klass [Class|String] a subclass of +Pragma::Operation::Base+
17
17
  def run(operation_klass)
18
18
  result = operation_klass.to_s.constantize.call(
19
- params: operation_params,
19
+ params: operation_params.to_h,
20
20
  current_user: operation_user
21
21
  )
22
22
 
@@ -25,7 +25,9 @@ module Pragma
25
25
  end
26
26
 
27
27
  if result.resource
28
- render status: result.status, json: result.resource.to_hash
28
+ render status: result.status, json: result.resource.to_json(user_options: {
29
+ expand: params[:expand]
30
+ })
29
31
  else
30
32
  head result.status
31
33
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+ Pragma::Operation::Index.class_eval do
3
+ def build_page_url(page)
4
+ Rails.application.routes.url_heleprs.url_for(params.merge(
5
+ page_param => page,
6
+ only_path: true
7
+ ).symbolize_keys)
8
+ end
9
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Pragma
3
3
  module Rails
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
6
6
  end
data/lib/pragma/rails.rb CHANGED
@@ -5,6 +5,7 @@ require 'rails'
5
5
  require 'pragma/rails/version'
6
6
  require 'pragma/rails/controller'
7
7
  require 'pragma/rails/resource_controller'
8
+ require 'pragma/rails/hooks'
8
9
 
9
10
  module Pragma
10
11
  # Ruby on Rails integration for the Pragma architecture.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pragma-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Desantis
@@ -147,6 +147,7 @@ files:
147
147
  - bin/setup
148
148
  - lib/pragma/rails.rb
149
149
  - lib/pragma/rails/controller.rb
150
+ - lib/pragma/rails/hooks.rb
150
151
  - lib/pragma/rails/resource_controller.rb
151
152
  - lib/pragma/rails/version.rb
152
153
  - pragma-rails.gemspec