Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better lint #1108

Merged
merged 1 commit into from
Aug 31, 2015
Merged

Better lint #1108

merged 1 commit into from
Aug 31, 2015

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Aug 31, 2015

Extracted from
https://github.com/rails-api/active_model_serializers/pull/1004/files#diff-56455571c4ba7a2b4c640b9e8168f522R40

      actual_arity = resource.method(:read_attribute_for_serialization).arity
      if defined?(::Rubinius)
        #  1 for def read_attribute_for_serialization(name); end
        # -2 for alias :read_attribute_for_serialization :send for rbx because :shrug:
        assert_includes [1, -2], actual_arity, "expected #{actual_arity.inspect} to be 1 or -2"
      else
        # using absolute value since arity is:
        #  1 for def read_attribute_for_serialization(name); end
        # -1 for alias :read_attribute_for_serialization :send
        assert_includes [1, -1], actual_arity, "expected #{actual_arity.inspect} to be 1 or -1"
      end

Correct cache_key lint for ActiveRecord 4.1+

https://github.com/rails/rails/blob/4-0-stable/activerecord/lib/active_record/integration.rb
def cache_key

https://github.com/rails/rails/blob/4-1-stable/activerecord/lib/active_record/integration.rb
def cache_key(*timestamp_names)

@joaomdmoura
Copy link
Member

Nice, thank you @bf4, merging it

joaomdmoura added a commit that referenced this pull request Aug 31, 2015
@joaomdmoura joaomdmoura merged commit 5f03454 into rails-api:master Aug 31, 2015
@bf4 bf4 deleted the better_lint branch August 31, 2015 05:41
@bf4
Copy link
Member Author

bf4 commented Aug 31, 2015

wee!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants