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

Expense "from_archived_workspaces" filter does not work #8

Open
einzige opened this issue Apr 1, 2014 · 2 comments
Open

Expense "from_archived_workspaces" filter does not work #8

einzige opened this issue Apr 1, 2014 · 2 comments

Comments

@einzige
Copy link
Contributor

einzige commented Apr 1, 2014

@cantino other filters work perfectly. This one fails (always returns same results):

2.0.0-p247 :010 > Mavenlink::Expense.scoped.filter(from_archived_workspaces: true).all
I, [2014-04-01T22:14:58.019563 #99449]  INFO -- : [Maven] Started GET /expenses with {"from_archived_workspaces"=>true}
I, [2014-04-01T22:15:06.944734 #99449]  INFO -- : [Maven] Received response:
I, [2014-04-01T22:15:06.946114 #99449]  INFO -- : {
     "count" => 2,
  "expenses" => {
    "21316325" => {
         "amount_in_cents" => 123,
                "category" => "Travel",
              "created_at" => "2014-04-01T00:40:33-07:00",
                "currency" => "USD",
      "currency_base_unit" => 100,
         "currency_symbol" => "$",
                    "date" => "2013-02-19",
                      "id" => "21316325",
             "is_billable" => false,
             "is_invoiced" => false,
                   "notes" => nil,
              "updated_at" => "2014-04-01T00:40:33-07:00",
           "user_can_edit" => true,
                 "user_id" => "4576975",
            "workspace_id" => "4894095"
    },
    "21336035" => {
         "amount_in_cents" => 1,
                "category" => "Travel",
              "created_at" => "2014-04-01T07:13:16-07:00",
                "currency" => "USD",
      "currency_base_unit" => 100,
         "currency_symbol" => "$",
                    "date" => "2015-01-01",
                      "id" => "21336035",
             "is_billable" => false,
             "is_invoiced" => false,
                   "notes" => nil,
              "updated_at" => "2014-04-01T07:13:16-07:00",
           "user_can_edit" => true,
                 "user_id" => "4576975",
            "workspace_id" => "4894095"
    }
  },
   "results" => [
    [0] {
       "id" => "21336035",
      "key" => "expenses"
    },
    [1] {
       "id" => "21316325",
      "key" => "expenses"
    }
  ]
}
[
  [0] {
       "amount_in_cents" => 1,
              "category" => "Travel",
            "created_at" => "2014-04-01T07:13:16-07:00",
              "currency" => "USD",
    "currency_base_unit" => 100,
       "currency_symbol" => "$",
                  "date" => "2015-01-01",
                    "id" => "21336035",
           "is_billable" => false,
           "is_invoiced" => false,
                 "notes" => nil,
            "updated_at" => "2014-04-01T07:13:16-07:00",
         "user_can_edit" => true,
               "user_id" => "4576975",
          "workspace_id" => "4894095"
  },
  [1] {
       "amount_in_cents" => 123,
              "category" => "Travel",
            "created_at" => "2014-04-01T00:40:33-07:00",
              "currency" => "USD",
    "currency_base_unit" => 100,
       "currency_symbol" => "$",
                  "date" => "2013-02-19",
                    "id" => "21316325",
           "is_billable" => false,
           "is_invoiced" => false,
                 "notes" => nil,
            "updated_at" => "2014-04-01T00:40:33-07:00",
         "user_can_edit" => true,
               "user_id" => "4576975",
          "workspace_id" => "4894095"
  }
]
2.0.0-p247 :011 > Mavenlink::Expense.scoped.filter(from_archived_workspaces: false).all
I, [2014-04-01T22:15:15.709791 #99449]  INFO -- : [Maven] Started GET /expenses with {"from_archived_workspaces"=>false}
I, [2014-04-01T22:15:16.904365 #99449]  INFO -- : [Maven] Received response:
I, [2014-04-01T22:15:16.906461 #99449]  INFO -- : {
     "count" => 2,
  "expenses" => {
    "21316325" => {
         "amount_in_cents" => 123,
                "category" => "Travel",
              "created_at" => "2014-04-01T00:40:33-07:00",
                "currency" => "USD",
      "currency_base_unit" => 100,
         "currency_symbol" => "$",
                    "date" => "2013-02-19",
                      "id" => "21316325",
             "is_billable" => false,
             "is_invoiced" => false,
                   "notes" => nil,
              "updated_at" => "2014-04-01T00:40:33-07:00",
           "user_can_edit" => true,
                 "user_id" => "4576975",
            "workspace_id" => "4894095"
    },
    "21336035" => {
         "amount_in_cents" => 1,
                "category" => "Travel",
              "created_at" => "2014-04-01T07:13:16-07:00",
                "currency" => "USD",
      "currency_base_unit" => 100,
         "currency_symbol" => "$",
                    "date" => "2015-01-01",
                      "id" => "21336035",
             "is_billable" => false,
             "is_invoiced" => false,
                   "notes" => nil,
              "updated_at" => "2014-04-01T07:13:16-07:00",
           "user_can_edit" => true,
                 "user_id" => "4576975",
            "workspace_id" => "4894095"
    }
  },
   "results" => [
    [0] {
       "id" => "21336035",
      "key" => "expenses"
    },
    [1] {
       "id" => "21316325",
      "key" => "expenses"
    }
  ]
}
[
  [0] {
       "amount_in_cents" => 1,
              "category" => "Travel",
            "created_at" => "2014-04-01T07:13:16-07:00",
              "currency" => "USD",
    "currency_base_unit" => 100,
       "currency_symbol" => "$",
                  "date" => "2015-01-01",
                    "id" => "21336035",
           "is_billable" => false,
           "is_invoiced" => false,
                 "notes" => nil,
            "updated_at" => "2014-04-01T07:13:16-07:00",
         "user_can_edit" => true,
               "user_id" => "4576975",
          "workspace_id" => "4894095"
  },
  [1] {
       "amount_in_cents" => 123,
              "category" => "Travel",
            "created_at" => "2014-04-01T00:40:33-07:00",
              "currency" => "USD",
    "currency_base_unit" => 100,
       "currency_symbol" => "$",
                  "date" => "2013-02-19",
                    "id" => "21316325",
           "is_billable" => false,
           "is_invoiced" => false,
                 "notes" => nil,
            "updated_at" => "2014-04-01T00:40:33-07:00",
         "user_can_edit" => true,
               "user_id" => "4576975",
          "workspace_id" => "4894095"
  }
]
@einzige einzige changed the title Expense "archive" filter does not work Expense "from_archived_workspaces" filter does not work Apr 1, 2014
@cantino
Copy link
Contributor

cantino commented Apr 2, 2014

And the expense is in a workspace that is archived?

@einzige
Copy link
Contributor Author

einzige commented Apr 3, 2014

Both expenses are in the same workspace #4894095 which is _not_ archived.

2.0.0-p247 :001 > Mavenlink::Expense.find 21316325
I, [2014-04-03T14:26:11.200975 #23021]  INFO -- : [Maven] Started GET /expenses with {"only"=>"21316325"}
I, [2014-04-03T14:26:12.758543 #23021]  INFO -- : [Maven] Received response:
I, [2014-04-03T14:26:12.761222 #23021]  INFO -- : {
     "count" => 1,
  "expenses" => {
    "21316325" => {
         "amount_in_cents" => 123,
                "category" => "Travel",
              "created_at" => "2014-04-01T00:40:33-07:00",
                "currency" => "USD",
      "currency_base_unit" => 100,
         "currency_symbol" => "$",
                    "date" => "2013-02-19",
                      "id" => "21316325",
             "is_billable" => false,
             "is_invoiced" => false,
                   "notes" => nil,
              "updated_at" => "2014-04-01T00:40:33-07:00",
           "user_can_edit" => true,
                 "user_id" => "4576975",
            "workspace_id" => "4894095"
    }
  },
   "results" => [
    [0] {
       "id" => "21316325",
      "key" => "expenses"
    }
  ]
}
{
     "amount_in_cents" => 123,
            "category" => "Travel",
          "created_at" => "2014-04-01T00:40:33-07:00",
            "currency" => "USD",
  "currency_base_unit" => 100,
     "currency_symbol" => "$",
                "date" => "2013-02-19",
                  "id" => "21316325",
         "is_billable" => false,
         "is_invoiced" => false,
               "notes" => nil,
          "updated_at" => "2014-04-01T00:40:33-07:00",
       "user_can_edit" => true,
             "user_id" => "4576975",
        "workspace_id" => "4894095"
}
2.0.0-p247 :002 > e = _
{
     "amount_in_cents" => 123,
            "category" => "Travel",
          "created_at" => "2014-04-01T00:40:33-07:00",
            "currency" => "USD",
  "currency_base_unit" => 100,
     "currency_symbol" => "$",
                "date" => "2013-02-19",
                  "id" => "21316325",
         "is_billable" => false,
         "is_invoiced" => false,
               "notes" => nil,
          "updated_at" => "2014-04-01T00:40:33-07:00",
       "user_can_edit" => true,
             "user_id" => "4576975",
        "workspace_id" => "4894095"
}
2.0.0-p247 :003 > e.workspace
I, [2014-04-03T14:26:19.391861 #23021]  INFO -- : [Maven] Started GET /expenses with {"only"=>"21316325", "include"=>"workspace"}
I, [2014-04-03T14:26:20.857848 #23021]  INFO -- : [Maven] Received response:
I, [2014-04-03T14:26:20.871687 #23021]  INFO -- : {
       "count" => 1,
    "expenses" => {
    "21316325" => {
         "amount_in_cents" => 123,
                "category" => "Travel",
              "created_at" => "2014-04-01T00:40:33-07:00",
                "currency" => "USD",
      "currency_base_unit" => 100,
         "currency_symbol" => "$",
                    "date" => "2013-02-19",
                      "id" => "21316325",
             "is_billable" => false,
             "is_invoiced" => false,
                   "notes" => nil,
              "updated_at" => "2014-04-01T00:40:33-07:00",
           "user_can_edit" => true,
                 "user_id" => "4576975",
            "workspace_id" => "4894095"
    }
  },
     "results" => [
    [0] {
       "id" => "21316325",
      "key" => "expenses"
    }
  ],
  "workspaces" => {
    "4894095" => {
                   "archived" => false,
                "budget_used" => "$0",
                   "budgeted" => true,
      "can_create_line_items" => true,
                 "can_invite" => true,
      "change_orders_enabled" => true,
           "client_role_name" => "Clients",
       "consultant_role_name" => "Consultants",
                 "created_at" => "2014-03-23T00:42:56-07:00",
                 "creator_id" => "4576975",
                   "currency" => "USD",
         "currency_base_unit" => 100,
            "currency_symbol" => "$",
               "default_rate" => nil,
                "description" => "",
         "effective_due_date" => "",
          "has_budget_access" => true,
                         "id" => "4894095",
                "over_budget" => false,
                "permissions" => {
        "can_private_message" => true,
           "can_upload_files" => true
      },
                      "price" => "TBD",
             "price_in_cents" => nil,
                      "title" => "Changed through console",
                 "updated_at" => "2014-04-01T07:29:25-07:00"
    }
  }
}
{
               "archived" => false,
            "budget_used" => "$0",
               "budgeted" => true,
  "can_create_line_items" => true,
             "can_invite" => true,
  "change_orders_enabled" => true,
       "client_role_name" => "Clients",
   "consultant_role_name" => "Consultants",
             "created_at" => "2014-03-23T00:42:56-07:00",
             "creator_id" => "4576975",
               "currency" => "USD",
     "currency_base_unit" => 100,
        "currency_symbol" => "$",
           "default_rate" => nil,
            "description" => "",
     "effective_due_date" => "",
      "has_budget_access" => true,
                     "id" => "4894095",
            "over_budget" => false,
            "permissions" => {
    "can_private_message" => true,
       "can_upload_files" => true
  },
                  "price" => "TBD",
         "price_in_cents" => nil,
                  "title" => "Changed through console",
             "updated_at" => "2014-04-01T07:29:25-07:00"
}

einzige pushed a commit to einzige/mavenlink_gem that referenced this issue Aug 19, 2016
…time_entries_specification

Revert "remove incorrect update attribute for time entries"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants