Skip to content

Conversation

@unn4m3d
Copy link

@unn4m3d unn4m3d commented Mar 23, 2018

Now survey seems to work with Rails 5.

There was a snippet of code in lib/survey.rb

  def rails4?
    return defined?(Rails) && Rails::VERSION::MAJOR == 4
  end

  def in_rails_3(&block)
    yield if block_given? unless rails4?
  end

Perhaps it should be replaced with something like that?

def rails3?
  return defined?(Rails) && Rails::VERSION::MAJOR < 4
end

def in_rails_3(&block)
  yield if block_given? && rails3?
end

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.

1 participant