Skip to content

Commit

Permalink
Fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesreggio committed Jul 27, 2016
1 parent 6e58bc0 commit b25f294
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion graphql-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ require 'graphql/rails/version'
Gem::Specification.new do |s|
s.name = 'graphql-rails'
s.version = GraphQL::Rails::VERSION
s.license = 'MIT'
s.authors = ['James Reggio']
s.email = ['james.reggio@gmail.com']
s.homepage = 'https://github.com/jamesreggio/graphql-rails'
Expand All @@ -16,7 +17,7 @@ Allows you to specify GraphQL queries and mutations as though they were
controller actions. Automatically maps Mongoid models to GraphQL types.
Seamlessly integrates with CanCan.
EOM
s.license = 'MIT'
s.required_ruby_version = '>= 2.1.0'

s.files = Dir['{app,config,lib}/**/*', 'LICENSE']
s.required_ruby_version = '>= 2.1.0'
Expand Down
2 changes: 2 additions & 0 deletions lib/graphql/rails/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def run(&block)
instance_eval(&block)
end

private

def method_missing(method, *args, &block)
begin
@self.send(method, *args, &block)
Expand Down
2 changes: 1 addition & 1 deletion lib/graphql/rails/extensions/cancan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def self.check_authorization(options = {})
end
end

def skip_authorization_check(*args)
def self.skip_authorization_check(*args)
self.before_filter(*args) do |instance|
instance.instance_variable_set(:@authorized, true)
end
Expand Down
1 change: 1 addition & 0 deletions lib/graphql/rails/extensions/mongoid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def namespace
# mappings for common built-in scalar types.
def types
@types ||= {
Boolean => GraphQL::BOOLEAN_TYPE,
::Mongoid::Boolean => GraphQL::BOOLEAN_TYPE,
BSON::ObjectId => GraphQL::STRING_TYPE,
}
Expand Down
1 change: 1 addition & 0 deletions lib/graphql/rails/node_identification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module GraphQL
module Rails
# Implements globally-unique object IDs for Relay compatibility.
NodeIdentification = GraphQL::Relay::GlobalNodeIdentification.define do
# TODO: Add security checks.
object_from_id -> (id, ctx) do
Types.lookup(*NodeIdentification.from_global_id(id))
end
Expand Down
1 change: 1 addition & 0 deletions lib/graphql/rails/operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def self.query(hash, &block)
private

# DSL for query definition.
# TODO: Support resolve-only blocks.
class QueryDefinition < DSL
attr_reader :field

Expand Down
1 change: 0 additions & 1 deletion lib/graphql/rails/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def to_field_name(name)
def types
@types ||= {
String => GraphQL::STRING_TYPE,
Boolean => GraphQL::BOOLEAN_TYPE,

Fixnum => GraphQL::INT_TYPE,
Integer => GraphQL::INT_TYPE,
Expand Down

0 comments on commit b25f294

Please sign in to comment.