Skip to content

Commit c9ae4b4

Browse files
askl56lgebhardt
authored andcommitted
updated hash syntax to ruby 1.9
1 parent 7e729bd commit c9ae4b4

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

lib/jsonapi/include_directives.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ class IncludeDirectives
55
# For example ['posts.comments.tags']
66
# will transform into =>
77
# {
8-
# :posts=>{
9-
# :include=>true,
10-
# :include_related=>{
11-
# :comments=>{
12-
# :include=>true,
13-
# :include_related=>{
14-
# :tags=>{
15-
# :include=>true
8+
# posts:{
9+
# include:true,
10+
# include_related:{
11+
# comments:{
12+
# include:true,
13+
# include_related:{
14+
# tags:{
15+
# include:true
1616
# }
1717
# }
1818
# }

lib/jsonapi/resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ def _as_parent_key
569569
end
570570

571571
def _allowed_filters
572-
!@_allowed_filters.nil? ? @_allowed_filters : { :id => {} }
572+
!@_allowed_filters.nil? ? @_allowed_filters : { id: {} }
573573
end
574574

575575
def _resource_name_from_type(type)

test/controllers/controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ def test_valid_filter_value
19011901
def test_get_related_resource
19021902
JSONAPI.configuration.json_key_format = :dasherized_key
19031903
JSONAPI.configuration.route_format = :underscored_key
1904-
get :get_related_resource, {post_id: '2', association: 'author', :source=>'posts'}
1904+
get :get_related_resource, {post_id: '2', association: 'author', source:'posts'}
19051905
assert_response :success
19061906
assert_hash_equals(
19071907
{
@@ -1954,7 +1954,7 @@ def test_get_related_resource
19541954
end
19551955

19561956
def test_get_related_resource_nil
1957-
get :get_related_resource, {post_id: '17', association: 'author', :source=>'posts'}
1957+
get :get_related_resource, {post_id: '17', association: 'author', source:'posts'}
19581958
assert_response :success
19591959
assert_hash_equals json_response,
19601960
{

test/fixtures/active_record.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
t.string :spouse_name
9898
t.text :bio
9999
t.float :quality_rating
100-
t.decimal :salary, :precision => 12, :scale => 2
100+
t.decimal :salary, precision: 12, scale: 2
101101
t.datetime :date_time_joined
102102
t.date :birthday
103103
t.time :bedtime
@@ -706,7 +706,7 @@ class BreedResource < JSONAPI::Resource
706706
attribute :name, format: :title
707707

708708
# This is unneeded, just here for testing
709-
routing_options :param => :id
709+
routing_options param: :id
710710

711711
def self.find(filters, options = {})
712712
breeds = []

0 commit comments

Comments
 (0)